bug-ncurses
[Top][All Lists]
Advanced

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

Re: Library directory missing in pkg-config files


From: Thomas Dickey
Subject: Re: Library directory missing in pkg-config files
Date: Tue, 4 Oct 2022 19:27:26 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Oct 04, 2022 at 04:29:33PM +0200, Michał Liszcz wrote:
> Hi,
> 
> I'm using 6.3.20211021. I configured ncurses with a custom --prefix, I also
> specified --enable-pc-files and --with-pkg-config-libdir pointing to some
> directory inside the installation prefix.
> 
> Below is a generated pkg-config file installed into prefix:
> 
>  # pkg-config file generated by gen-pkgconfig
>  # vile:makemode
> 
>  prefix=prefix-ncurses
>  exec_prefix=${prefix}
>  libdir=${exec_prefix}/lib
>  includedir=${prefix}/include/ncurses
>  abi_version=6
>  major_version=6
>  version=6.3.20211021
> 
>  Name: ncurses
>  Description: ncurses 6.3 library
>  Version: ${version}
>  URL: https://invisible-island.net/ncurses
>  Requires.private:
>  Libs: -lncurses -ltinfo
>  Libs.private:
>  Cflags:  -D_GNU_SOURCE -I${includedir} -I/prefix-ncurses/include
> 
> I am not able to link my application with ncurses because the custom library
> directory is not exposed to pkg-config, i.e. this commands:
> 
>  env PKG_CONFIG_PATH=/prefix-ncurses/pkgconfig pkg-config --libs ncurses
> 
> Prints:
> 
>  -lncurses -ltinfo
> 
> While I think it should print:
> 
>  -L/prefix-ncurses/lib -lncurses -ltinfo

The configure/etc scripts check for the case where you're installing
into the linker's predefined path -- and filter _that_ "-L" option out.

Other -L options that it knows about are passed into the ".pc" file.
 
> I managed to fix this locally by changing misc/gen-pkgconfig.in:
> 
>  - Libs: $lib_flags $LIBS
>  + Libs: -L$show_libdir $lib_flags $LIBS
> 
> Could you please consider changing gen-pkgconfig.in as proposed above?

I think you left out the essential information:

a) the actual configure options used,

b) the resulting config.status file (which includes (a)).

-- 
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]