Help with makefile options

Beech Rintoul beech at alaskaparadise.com
Thu May 18 02:20:36 UTC 2006


On Wednesday 17 May 2006 17:15, Alejandro Pulver wrote:
> 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

Thanks, that helped a lot. I was having trouble getting my head around the 
need to define those options backwards. I wasn't thinking far enough ahead 
about pointyhat running in BATCH mode. Anyway, now it's clear why it's done 
that way :)

Beech

-- 

---------------------------------------------------------------------------------------
Beech Rintoul - Sys. Administrator - beech at alaskaparadise.com
/"\   ASCII Ribbon Campaign  | Alaska Paradise
\ / - NO HTML/RTF in e-mail  | 201 East 9Th Avenue Ste.310
 X  - NO Word docs in e-mail | Anchorage, AK 99501
/ \  - Please visit Alaska Paradise - http://www.alaskaparadise.com
---------------------------------------------------------------------------------------











-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20060518/185e2529/attachment.pgp


More information about the freebsd-ports mailing list