Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Nov 2005 23:30:30 GMT
From:      Mats Dufberg <mats@dufberg.se>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/89648: OPTIONS and conditional USE_* conflict in bsd.port.pre.mk
Message-ID:  <200511272330.jARNUULG038420@www.freebsd.org>
Resent-Message-ID: <200511272340.jARNe2bE089967@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511272330.jARNUULG038420>