Help with makefile options

Alejandro Pulver alepulver at FreeBSD.org
Thu May 18 01:15:44 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 17 May 2006 13:06:30 -0800
Beech Rintoul <beech at alaskaparadise.com> wrote:

> I submitted an update and the comitter didn't like the way options
> were defined. He said:
> 
> >  On Wednesday 17 May 2006 03:56, you wrote:
> >  > Could you please check the way you use OPTIONS against the
> > respective > PH chapter ? (check "on" options against WITHOUT and
> > "off" against WITH) > (I don't think you actually break something
> > because the "bug" mentioned > there only affects make
> > depend /describe, but let's be consistent).
> 
> "Due to a deficiency in the infrastructure, you can only test WITH_*
> variables for options, which are OFF by default, and WITHOUT_*
> variables for options, which defaults to ON"
> 
> And an example:
> 
> OPTIONS=        IPV6 "Use IPv6" off \
> .if defined(WITH_IPV6)
> .if defined(WITHOUT_IPV6)
> second .if should be: ,if !defined(WITH_IPV6)
> 
>  > grep IFSESSION Makefile
>                 IFSESSION "Include mod_ifsession" on \
> .if defined(WITH_IFSESSION)
> should be .if !defined(WITHOUT_IFSESSION)
> 
> How would this work? It looks to me like they would be defined as
> opposite of what they are intended to do. Could someone explain this
> to me? I seem to be missing something.
> 

Hello.

This works when building without BATCH, but it won't work for example in
pointyhat (when building the binary packages).

When you select an option, the variable WITH_option is defined, and
when you deselect it, WITHOUT_option is defined. The problem is that
when you build with BATCH, *nothing* is defined. I also got confused
with this before.

For example, consider the following scenario, where nothing is defined:

1) .if defined(WITH_IFSESSION)

2) .if !defined(WITHOUT_IFSESSION)

In the first case the code won't be executed when BATCH is defined,
because there won't be WITH_/WITHOUT_ definitions. The only way to make
the code be executed is configuring the port (storing the options).

But in the second case, if nothing is defined the code will be
executed. This way it the check will only fail if the user deselects
the option, and WITHOUT_IFSESSION is defined.

Also, there is currently a patch in the queue (not applied yet) that
fixes this issue.

I hope I have been clear. If you have doubts about something you can
ask me.

Best Regards,
Ale
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFEa8q4iV05EpRcP2ERApLhAKC7Zt3eacnsmDYewCdfaPSKsJGT3wCcCdPH
3sIJTDWLlXRHLbnG4OHEtOY=
=e1YM
-----END PGP SIGNATURE-----


More information about the freebsd-ports mailing list