On Mon, Jun 19, 2006 at 11:23:32PM +0200, Rafael Laboissiere wrote:
> * Alan W. Irwin <irwin@...> [2006-06-19 09:20]:
>
> > >I think that the offending line is in pkgcfg/Makefile.am, specifically
> > >(annotated with ******)
> > >
> > >install-data-hook:
> > >if with_pkg_config
> > > $(mkinstalldirs) $(DESTDIR)$(docdir)
> > >****** $(INSTALL) `pwd`/$(top_srcdir)/pkgcfg/README
> > >$(DESTDIR)$(docdir)/README.pkg-config
> > >endif
> >
> > [...]
> >
> > Obviously, this is a pretty clumsy workaround, and we should replace our
> > 'pwd' constructs with an implementation of $(abs_top_pl_srcdir) and
> > $(abs_top_pl_builddir) which works for both relative and absolute paths.
> >
> > Rafael, can you come up with such an implementation?
>
> I looked at the specific problem with the pwd in pkgcfg/Makefile.am and
> noticed that it was introduced in revision 1.15 of the file:
>
> $ cvs diff -r1.14 -r1.15 Makefile.am
> Index: Makefile.am
> ===================================================================
> RCS file: /cvsroot/plplot/plplot/pkgcfg/Makefile.am,v
> retrieving revision 1.14
> retrieving revision 1.15
> diff -u -r1.14 -r1.15
> --- Makefile.am 12 May 2006 19:04:37 -0000 1.14
> +++ Makefile.am 13 May 2006 15:24:32 -0000 1.15
> @@ -62,7 +62,7 @@
> install-data-hook:
> if with_pkg_config
> $(mkinstalldirs) $(DESTDIR)$(docdir)
> - $(INSTALL) README $(DESTDIR)$(docdir)/README.pkg-config
> + $(INSTALL) `pwd`/$(top_srcdir)/pkgcfg/README $(DESTDIR)$(docdir)/README.pkg-config
> endif
>
> EXTRA_DIST = README
>
>
> This was done by Andrew Ross:
>
>
> $ cvs log -r1.15 Makefile.am
> RCS file: /cvsroot/plplot/plplot/pkgcfg/Makefile.am,v
> Working file: Makefile.am
> head: 1.15
> branch:
> locks: strict
> access list:
> keyword substitution: kv
> total revisions: 15; selected revisions: 1
> description:
> ----------------------------
> revision 1.15
> date: 2006/05/13 15:24:32; author: andrewross; state: Exp; lines: +1 -1
> Fix installation of README.pkg-config to work with a separate build tree.
> =============================================================================
>
>
> I do not know why Andrew decided to use the pwd command but, actually,
> "`pwd`/$(top_srcdir)/" is strictly the same as just "$(top_srcdir)/" when
> top_srcdir is relative (which should be the case in normal situations).
> When top_srcdir is absolute, the second form should work fine. Therefore,
> I did not see reasons for using pwd here. Andrew?
>
> I just committed a "fixed" version of pkgcfg/Makefile.am. Please, test it.
> If this works, we can audit the other files where pwd is used and just try
> similar fixes.
Rafael,
I don't think there was a particular reason for using `pwd`. I seem to
recall just copying the code from one of the other Makefiles. Doesn't
seem entirely sensible to me now... Sorry!
Andrew
|