ports/89648: OPTIONS and conditional USE_* conflict in bsd.port.pre.mk

Mats Dufberg mats at dufberg.se
Sun Nov 27 23:40:25 UTC 2005


>Number:         89648
>Category:       ports
>Synopsis:       OPTIONS and conditional USE_* conflict in bsd.port.pre.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 27 23:40:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Mats Dufberg
>Release:        N/A
>Organization:
private
>Environment:
N/A
>Description:
With OPTIONS in a ports Makefile it is possible to make settings being
permanent, i.e. the user just has to set them once, and at next update
the same settings are valid. It is, however, not possible to combine OPTIONS
with conditional use of e.g. USE_OPENSSL:

  OPTIONS=        SSL "Compile with SSL support" on

  .include <bsd.port.pre.mk>

  .if defined(WITHOUT_SSL)
  MAKE_ARGS+=     SSLTYPE=none
  .else
  USE_OPENSSL=  yes
  EXTRA_OPTS+=    SSLINCLUDE=${OPENSSLINC} SSLLIB=${OPENSSLLIB}
  .endif

It will fail because "bsd.port.pre.mk" must be included after "USE_OPENSSL"
is set.

  OPTIONS=        SSL "Compile with SSL support" on

  .if defined(WITHOUT_SSL)
  MAKE_ARGS+=     SSLTYPE=none
  .else
  USE_OPENSSL=  yes
  EXTRA_OPTS+=    SSLINCLUDE=${OPENSSLINC} SSLLIB=${OPENSSLLIB}
  .endif

  .include <bsd.port.pre.mk>

It will fail because "bsd.port.pre.mk" must be included directly after
OPTIONS before any option is "used".

There is a work-around in this case, and that is to copy what happens when
"USE_OPENSSL" is set:

  OPTIONS=        SSL "Compile with SSL support" on

  .include <bsd.port.pre.mk>

  .if defined(WITHOUT_SSL)
  MAKE_ARGS+=     SSLTYPE=none
  .else
  .include "${PORTSDIR}/Mk/bsd.openssl.mk"
  EXTRA_OPTS+=    SSLINCLUDE=${OPENSSLINC} SSLLIB=${OPENSSLLIB}
  .endif

The need to use the work-around makes it less appealing to use OPTIONS, and
might make the move to use OPTIONS take longer time.





            
>How-To-Repeat:
              
>Fix:
I do not have full understanding of bsd.port.mk to include a patch. Moving the 
border between bsd.port.pre.mk and bsd.port.post.mk might be a solution.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list