On Fri, May 11, 2007 at 04:32:38PM +0200, Stefan Sperling wrote: > Hello Holger, > is there a specific reason why the olsrd port does not build > and install plugins that are provided along with the olsrd > source distribution?
Replying to myself since I think I found the reason reading
through the ports docs. Of course, installing shared libs
unconditionally even when NO_SHARED_LIBS is set to "Yes" is
a bad idea :-/
I'm not even sure if olsrd compiles on architectures
that don't support shared libraries because the code seems
to use dlopen() and friends unconditionally...
But anyway, I've tried to make this port decide whether to install
plugins based on NO_SHARED_LIBS and hit a problem.
The problem is that the do-install target needs to know whether
NO_SHARED_LIBS is set to decide whether to copy shared libs into
the fake installation tree:
# Cannot include bsd.port.mk here because we override do-install
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/olsrd ${PREFIX}/sbin
@cd ${WRKSRC}/files && ${GUNZIP_CMD} olsrd.conf.5.gz olsrd.8.gz
${INSTALL_MAN} ${WRKSRC}/files/olsrd.conf.5 ${PREFIX}/man/man5
${INSTALL_MAN} ${WRKSRC}/files/olsrd.8 ${PREFIX}/man/man8
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/olsrd
${INSTALL_DATA} ${WRKSRC}/files/olsrd.conf.default.* \
${PREFIX}/share/examples/olsrd
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/olsrd
@for i in CHANGELOG README README-Link-Quality*; do \
${INSTALL_DATA} ${WRKSRC}/$$i ${PREFIX}/share/doc/olsrd; \
done
# Need to know whether NO_SHARED_LIBS is defined here
.include <bsd.port.mk>
# NO_SHARED_LIBS defined here
What is the general approach to this kind of problem in
the OpenBSD ports tree?
I've seen some ports patch upstream Makefiles so they heed
NO_SHARED_LIBS and put NO_SHARED_LIBS into MAKE_ENV.
Should the do-install target from net/olsrd/Makefile go
into a patch to the upstream Makefile?
I've tried to replace the upstream install: target with the rules
in do-install:, but that does not really work well because
a few macros, e.g. ${INSTALL_PROGRAM}, end up being undefined
when the install: target is called. Should I put all those
undefined macros into MAKE_ENV? Or is there a better way to
deal with this?
--
stefan
http://stsp.name PGP Key: 0xF59D25F0
pgpwMQYsHkISP.pgp
Description: PGP signature
