[libvirt] [PATCH] build: Fix build with old automake
Jiri Denemark
jdenemar at redhat.com
Fri Mar 14 18:55:38 UTC 2014
On Fri, Mar 14, 2014 at 07:54:58 -0600, Eric Blake wrote:
> On 03/14/2014 04:43 AM, Jiri Denemark wrote:
> > Ancient automake (such as from RHEL5) does not provide abs_srcdir and
> > abs_builddir variables which are used by a recent commit of mine
> > (e562e82).
> >
> > Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> > ---
> > src/Makefile.am | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/src/Makefile.am b/src/Makefile.am
> > index d4d7b2b..fce9056 100644
> > --- a/src/Makefile.am
> > +++ b/src/Makefile.am
> > @@ -16,6 +16,10 @@
> > ## License along with this library. If not, see
> > ## <http://www.gnu.org/licenses/>.
> >
> > +# old automake does not provide abs_{src,build}dir variables
> > +abs_builddir = $(shell pwd)
> > +abs_srcdir = $(shell cd $(srcdir) && pwd)
>
> Luckily we require GNU make, so this works. It would be nice, however,
> if src/Makefile.am and tests/Makefile.am shared the same formulas; right
> now, tests/Makefile.am uses the more portable (but slower):
>
> AM_CFLAGS = ...
> -Dabs_builddir="\"`pwd`\"" \
> -Dabs_srcdir="\"`cd '$(srcdir)'; pwd`\"" \
Which is unusable in this case, because we don't need to pass the
variables to the compiler. It's make itself that needs to consume the
variables:
$(abs_builddir)/cpu/cpu_map.xml:
$(AM_V_GEN)ln -s $(abs_srcdir)/cpu/cpu_map.xml $@
Jirka
More information about the libvir-list
mailing list