Subject: Re: proposal of how to deal with missing header files supplied by nbcompat
To: Dieter Baron <dillo@danbala.ifoer.tuwien.ac.at>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 12/01/2005 20:21:06
>   The buildlink framework makes sure that ${LOCALBASE}/include and
> ${LOCALBASE}/lib are not searched during package build.  Instead, the
> files the package needs is linked into ${WRKDIR}/.buildlink/include
> and ${WRKDIR}/.buildlink/lib, which avoids that the package picks up
> other installed files it has optional support for.

I know, and in order to avoid having to implement another additional
mechanism my probosal was just to add links in ${LOCALBASE}/include and
list them in libnbcompat's PLIST so that if libnbcompat/buildlink3.mk was
included these files or symlinks would automatically be copies to
${WRKDIR}/.buildlink/include where the build process would find them.
The advantage would be that no extra code would have been needed
except for some code run when installing libnbcompat.

> 
>   This mechanism is generic enough to allow us to link only those
> files from ${LOCALBASE}/include/nbcompat needed by the package but not
> provided by the system into ${WRKDIR}/.buildlink/include, so they will
> be found by the compiler.  (The other files will not be found, since
> ${LOCALBASE}/include/nbcompat is not searched.)

nor is, and that is more important here, ${WRKDIR}/.buildlink/include/nbcompat.

so you would suggest to symlink the requested header files found in
${WRKDIR}/.buildlink/include/nbcompat to ${WRKDIR}/.buildlink/include
on compile time of a package?
The open issue to me here is how to ensure that this happens only after
${WRKDIR}/.buildlink/include has been created and still could be triggered
simply by including ../../mk/libnbcompat.buildlink3.mk?


>   Many packages don't care, as long as all functions they use are
> provided.  LIBNBCOMPAT_AUTO_VARS is an easy way to achieve that: it
> adds LIBS+=-lnbcompat, so if the build of the package honours LIBS,
> nothing further needs to be done.  If the package cares, don't set
> LIBNBCOMPAT_AUTO_VARS.  The same mechanism is used for pthread, and it
> works well there.

I probably have to take a closer look into that.


-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 georg.schwarz@freenet.de  +49 178 8545053