HEADSUP: WITH and WITHOUT options knobs checking

Arseny Nasokin tarc at tarc.po.cs.msu.su
Tue Jun 27 14:37:00 UTC 2006


It's wrong if you write in your Makefiles something about:
--------------%<----------------
...
OPTIONS= ABC "Enable abc feature" off 
...
.include <bsd.port.pre.mk>
...
.if defined (WITH_ABC)
# configure ABC feature
.endif
...
.include <bsd.port.post.mk>
------------->%-----------------

The main reason is that, ${OPTIONSFILE} included as is, and if you enable ABC(as in example), you have in ${OPTIONSFILE} something about:
--------------%<----------------
...
WITH_ABC=true
...
------------->%-----------------


Ok, and now some experiments.
If ABC is feature, that you want enable im many ports (for example, OPTIMIZED_FLAGS or THREADS, or ESOUND/ESD.....)
you possibly want add it to your /etc/make.conf file.

cat WITH_ABC=true >>  /etc/make.conf 

than, you want compile port, without this feature. You do `make config' and as result in your ${OPTIONSFILE} you have:
--------------%<----------------
...
WITHOUT_ABC=true
...
------------->%-----------------

And now - compile...

when you type `make build' you have defined BOTH `WITH_ABC' and `WITHOUT_ABC' knobs

and as you check _only_ WITH_ABC, this feature included. That's wrong!!!


Please, check WITH_ knobs, as it:
.if defined (WITH_ABC) && ! defined(WITHOUT_ABC)

-- 
   Best regards,
   	Arseny Nasokin


More information about the freebsd-ports mailing list