[PATCH] INSTALL doesn't belong in docdir

Gaetan Nadon memsize at videotron.ca
Sun Jan 3 13:50:28 PST 2010


On Sun, 2010-01-03 at 10:40 -0800, Dan Nicholson wrote:

> On Sun, Jan 3, 2010 at 3:34 AM, Julien Cristau <jcristau at debian.org> wrote:
> > On Sat, Jan  2, 2010 at 15:56:48 -0500, Gaetan Nadon wrote:
> >
> >> I did some test scenario regarding backward compatibility. It turns out
> >> setting docdir=pkgdatadir does not help. The value of docdir in the
> >> module's copy of INSTALL_CMD is set at configuration time. If the module
> >> was configured with macros @ v1.4, then the INSTALL_CMD will copy from
> >> share/doc every time the makefile target is invoked.
> >>
> > Actually that's probably fine, you can re-run configure if you upgrade the
> > macros.  Running configure and make in different environments has other
> > ways to break anyway.  The thing I feared was having the path to INSTALL
> > already expanded in the configure script.  Thoughts?
> 
> It should expand after running the xorg-macros configure so you can
> set prefix/datadir, but it had better be expanded before using it in
> another package. You wouldn't want to have package foo with
> --prefix=/junk and trying to pull INSTALL from
> /junk/share/xorg-macros/INSTALL when it's really in
> /usr/share/xorg-macros/INSTALL.
> 

Example using an xclock tarball (using current implementation):

app/xclock$ ./configure --prefix /home/nadon/xorg/src:


in configure:		macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir xorg-macros`
in configure:		INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" ...
in config.status:	S["INSTALL_CMD"]="(cp -f /home/nadon/xorg/src/share/doc/util-macros/INSTALL ...
in Makefile:		INSTALL_CMD = (cp -f /home/nadon/xorg/src/share/doc/util-macros/INSTALL ...


The "binding" between INSTALL_CMD and xorg-macros docdir occurs when the
xclock module is configured (when config.status is generated from
configure). It will pick-up the value of docdir from installed
xorg-macros.pc file.

Let's assume the patch is in with docdir=pkgdatadir

If xclock is "autoconf" against util-macros @1.4, the content of
INSTALL_CMD will be "--variable=docdir". If xclock is "./configure"
against an installed xorg-macros.pc @1.4, docdir value is
share/doc/util-macros with the prefix specified in this .pc file. This
works. If xclock is "./configure" against an installed xorg-macros.pc
@1.5, docdir value is share/util-macros with the prefix specified in
this .pc file. This works.

If xclock is "autoconf" against util-macros @1.5, the content of
INSTALL_CMD will be "--variable=pkgdatadir". If xclock is "./configure"
against an installed xorg-macros.pc @1.4, docdir value is
share/doc/util-macros with the prefix specified in this .pc file. No
INSTALL file, as expected. If xclock is "./configure" against an
installed xorg-macros.pc @1.5, pkgdatadir value is share/util-macros
with the prefix specified in this .pc file. This works.

I'll have to execute these test cases, it's harder than I thought. I
think I have just been demonstrating that the docdir workaround would
indeed work. Reason being I had not realized the INSTALL_CMD, being a
macro, is written at "autoconf" time rather than at "configure" time.

I don't think the value of pkgdatadir should be obtained at "make" time.
It would then depend on the pkg-config env variable which could be way
off and into places where none of the modules are installed. 

If I'am right, then the second patch would be ok. I'll be back.















> --
> Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20100103/e96fc7a2/attachment.html 


More information about the xorg-devel mailing list