Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: building source against installed libraries?
On Mon, Oct 31, 2022 at 12:07:03 +0100, Thomas Klausner wrote:
> On Mon, Oct 31, 2022 at 01:46:56PM +0300, Valeriy E. Ushakov wrote:
> > On Mon, Oct 31, 2022 at 11:10:24 +0100, Thomas Klausner wrote:
> >
> > > For test builds, I use 'USETOOLS=no make' to avoid building a
> > > toolchain. However that still wants to link against libraries built
> > > in the source tree, i.e. I have to 'cd /usr/src/lib/libcrypto &&
> > > USETOOLS=no make' to build a new libcrypto if this library is used.
> > >
> > > Is there a toggle to build against the installed libraries instead?
> >
> > It's entirely unclear from this description what exactly you are
> > trying to do and how does it fail.
>
> I'm trying this:
>
> wiz@yt:/usr/src/external/bsd/nsd> USETOOLS=no make
>
> and get
> ...
> all ===> lib/libnsd
> all ===> lib/libxfrd
> all ===> sbin
> all ===> sbin/nsd
> make[2]: don't know how to make /disk/6/archive/foreign/src/external/bsd/libevent/lib/libevent/libevent.a. Stop
>
> I want the build to use /usr/lib/libevent.a instead.
>
> > If I have to venture a guess (I don't have time atm to second guess/
> > reverse engineer the question), you are probably running into
> > something like LIBDPLIBS dependencies that are explicitly listed in
> > the in-tree makefiles, b/c those makefiles are intended to build the
> > in-tree code (e.g. for curses I would disable its LIBDPLIBS dependency
> > on terminfo). Just overriding them on the command line might help.
>
> I guess this is
>
> ./Makefile.inc:DPLIBS+= event ${NETBSDSRCDIR}/external/bsd/libevent/lib/libevent
>
> so perhaps what you're talking about?
Yes. Makefile.inc in nsd subdirs will use that variable to set
PROGDPLIBS and LIBDPLIBS - which are the real vars you want to avoid.
> What do I have to set? Do I have to do this for every library
> separately?
I'm afraid you will have to fix bsd.prog.mk :), b/c it uses PROGDPLIBS
to add libs to LDADD, etc. There's also incomplete s/BIN/PROG/ edito
in that code.
Pooka hacked bsd.lib.mk in revision 1.325 to do something like what
you want but for libs, and for individual libs only.
You probably want to add a bit of logic there that convert *DPLIBS
into -l for LDADD but without -L and without the dependency parts.
-uwe
Home |
Main Index |
Thread Index |
Old Index