From 2837201f268b7af4a20667e35db711d596e31d62 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Thu, 30 Nov 2006 20:44:44 +0000 Subject: [PATCH] Add a text on feature auto-detection in configure script being harmfull PR: docs/106065 (based on) Submitted by: Ganael LAPLANCHE --- .../books/porters-handbook/book.sgml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml index b9126d5709..fd8448e53a 100644 --- a/en_US.ISO8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml @@ -3865,6 +3865,47 @@ RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar + + Feature auto-activation + + When using a GNU configure script, keep an eye on which optional + features are activated by auto-detection. Explicitly disable + optional features you do not wish to be used by passing respective + --without-xxx or --disable-xxx + in CONFIGURE_ARGS. + + + Wrong handling of an option + .if defined(WITH_FOO) +LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo +CONFIGURE_ARGS+= --enable-foo +.endif + + + In the example above, imagine a library libfoo is installed on + the system. User does not want this application to use libfoo, so he + toggled the option off in the make config dialog. + But the application's configure script detects the library present in + the system and includes its support in the resulting executable. Now + when user decides to remove libfoo from the system, the ports system + does not protest (no dependency on libfoo was recorded) but the + application breaks. + + + Correct handling of an option + .if defined(WITH_FOO) +LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo +CONFIGURE_ARGS+= --enable-foo +.else +CONFIGURE_ARGS+= --disable-foo +.endif + + + In the second example, the library libfoo is explicitly disabled. + The configure script does not enable related features in the + application, despite library's presence in the system. + +