[PATCH 1/1] Allow $PREFIX relative paths in pkgconfigdir

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Does this change the default behavior at all? Also, can you give an
example of something you can do with this patch that you couldn't do
before.

-Tom

> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Does this change the default behavior at all? Also, can you give an
example of something you can do with this patch that you couldn't do
before.

Previously all paths were considered absolute. So using
--prefix =/home/$USER/.local --pkgconfigdir=lib/pkgconfig would try to
install the .pc file to /lib/pkgconfig.
The default behavior to install the file to $PREFIX/share/pkgconfig
is kept.
Invocations that use --pkgconfigdir=rel/path will change to
$PREFIX/rel/path .

The motivation was to allow simple switch from share/pkgconfig to
lib/pkgconfig (most libs on my system have pc file in lib/pkgconfig)
within the same prefix without having to write the absolute path.

regards,
Jan

> > Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
>
> Does this change the default behavior at all? Also, can you give an
> example of something you can do with this patch that you couldn't do
> before.

Previously all paths were considered absolute. So using
--prefix =/home/$USER/.local --pkgconfigdir=lib/pkgconfig would try to
install the .pc file to /lib/pkgconfig.
The default behavior to install the file to $PREFIX/share/pkgconfig
is kept.
Invocations that use --pkgconfigdir=rel/path will change to
$PREFIX/rel/path .

The motivation was to allow simple switch from share/pkgconfig to
lib/pkgconfig (most libs on my system have pc file in lib/pkgconfig)
within the same prefix without having to write the absolute path.

I think the current behavior is standard for most projects, so I think
we should leave the configure script as-is. I usually put my configure
invocations in a shell script, and you could achieve the same thing
with:

PREFIX=/home/$USER/.local ./configure --prefix=$PREFIX --pkgcofigdir=$PREFIX/lib/pkgconfig

Or you could just add $PREFIX/share/pkgconfig to your PKG_CONFIG_PATH.
The reason libclc installs its .pc file to $PREFIX/share/pkgconfig is
to simplify the install on multilib systems, since libclc is platform
independent.

-Tom

> > > Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
> >
> > Does this change the default behavior at all? Also, can you give an
> > example of something you can do with this patch that you couldn't do
> > before.
>
> Previously all paths were considered absolute. So using
> --prefix =/home/$USER/.local --pkgconfigdir=lib/pkgconfig would try to
> install the .pc file to /lib/pkgconfig.
> The default behavior to install the file to $PREFIX/share/pkgconfig
> is kept.
> Invocations that use --pkgconfigdir=rel/path will change to
> $PREFIX/rel/path .
>
> The motivation was to allow simple switch from share/pkgconfig to
> lib/pkgconfig (most libs on my system have pc file in lib/pkgconfig)
> within the same prefix without having to write the absolute path.

I think the current behavior is standard for most projects, so I think
we should leave the configure script as-is. I usually put my configure
invocations in a shell script, and you could achieve the same thing
with:

PREFIX=/home/$USER/.local ./configure --prefix=$PREFIX --pkgcofigdir=$PREFIX/lib/pkgconfig

Or you could just add $PREFIX/share/pkgconfig to your PKG_CONFIG_PATH.
The reason libclc installs its .pc file to $PREFIX/share/pkgconfig is
to simplify the install on multilib systems, since libclc is platform
independent.

OK, thanks for the explanation. I don't insist, it just made my life a
little easier.

thank you,
Jan