bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting pkgconfig to a specific location


From: Thomas Dickey
Subject: Re: Getting pkgconfig to a specific location
Date: Sat, 22 Jan 2022 14:12:18 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Jan 15, 2022 at 08:21:10AM -0500, Vincent Fortier wrote:
> I think I have found where the issues are...  I count two:
> 
> ISSUE 1:  Yes the configure script will use the value of PKG_CONFIG_LIBDIR.
> Problems with PKG_CONFIG_LIBDIR in conjunction with
> --with-pkg-config-libdir= are:
> a) when PKG_CONFIG_LIBDIR is set, that will always override the
> --with-pkg-config-libdir= argument
> c) if PKG_CONFIG_LIBDIR is NOT set, --with-pkg-config-libdir= is not
> being considered and falls back to default installation path
> (.../lib/x86_64-linux-gnu/...)
> b) when PKG_CONFIG_LIBDIR is set but without --with-pkg-config-libdir=
> , again it falls back to the default installation directory
> (.../lib/x86_64-linux-gnu/...) and does not consider PKG_CONFIG_LIBDIR
> at all
> 
> To me the first problem is:  it should use PKG_CONFIG_LIBDIR when
> defined but be overridden by --with-pkg-config-libdir=

current code (since November) does this:

https://github.com/ThomasDickey/ncurses-snapshots/blob/8d8559fefd06cb9157efe73ce2216004b152fc5b/aclocal.m4#L9296

# if $PKG_CONFIG_LIBDIR is set, try to use that
cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[  ]]*,,'`

# if the option is used, let that override.  otherwise default to "libdir"
AC_ARG_WITH(pkg-config-libdir,
        [  --with-pkg-config-libdir=XXX use given directory for installing 
pc-files],
        [cf_search_path=$withval],
        [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && 
cf_search_path=libdir])
> ---
> 
> ISSUE 2: PKG_CONFIG_LIBDIR considered relative to DESTDIR
> On every other package I build, PKG_CONFIG_LIBDIR variable is always
> defined and treated as having its full path.  The issue here is that
> ncurses always considers it relative to the destination directory.  As
> such the full path is being added on-top of the destination path,
> creating the other issue I'm facing.
> 
> On that front, PKG_CONFIG_LIBDIR should always be considered as
> defined with full path OR have a mechanism to check that somehow.

"should".  Unfortunately, the configure-script can't control everything.
Current code does this:

case x$cf_search_path in
(xlibdir)
        PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
        AC_MSG_RESULT($PKG_CONFIG_LIBDIR)
        cf_search_path=
        ;;
(x)
        ;;
(x/*)
        PKG_CONFIG_LIBDIR="$cf_search_path"
        AC_MSG_RESULT($PKG_CONFIG_LIBDIR)
        cf_search_path=
        ;;
(xyes|xauto)

...it can't control what's in ${libdir} because some users will override
the configured value at compile/install fime.

> ---
> 
> In the end, my only solution so far to make this work out properly is
> by setting the following two:
> 1- re-export PKG_CONFIG_LIBDIR so it is relative to the destination
> directory instead of using a full path
> 2- use --with-pkg-config-libdir which can be set to =BOGUS as it
> doesn't change a thing as not used.

please start from current code when proposing improvements :-)

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]