ports/75727: [patch] bsd.port.mk - use default OPTIONS when doing PACKAGE_BUILDING

Edwin Groothuis edwin at mavetju.org
Sun Jan 2 22:10:26 UTC 2005

>Number:         75727
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - use default OPTIONS when doing PACKAGE_BUILDING
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 02 22:10:25 GMT 2005
>Originator:     Edwin Groothuis
>Release:        FreeBSD 5.2.1-RELEASE i386
System: FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #7: Tue Sep 21 23:13:39 EST 2004 root at k7.mavetju:/usr/src-5.2.1/sys/i386/compile/k7 i386


Two issues:

- when running PACKAGE_BUILDING or BATCH, OPTIONS isn't honoured.
- when creating INDEX files, OPTIONS isn't honoured.


$ cd /usr/ports/databases/libdri-drivers

$ make -V OPTIONS
MYSQL   "With MySQL Driver" on  MSQL    "With MSQL Driver" off  PGSQL   "With PostgreSQL Driver" on  SQLITE     "With SQLite Driver" off

$ PACKAGE_BUILDING=1 make all-depends-list

$ PACKAGE_BUILDING=1 make all-depends-list


This patch only fixes it for when PACKAGE_BUILDING is set. I'm not
familiar enough with the building system to know what is set when
"make index" is called. With regarding to BATCH, the 
"if defined(PACKAGE_BUILDING)" could be replace with
"if defined(PACKAGE_BUILDING) || (defined(BATCH) && !exists(${_OPTIONSFILE}))"
and you have the same features there. It still doesn't help with
the "make index", but that's just one step away.

Oh, and zero additional shell commands.

--- /home/edwin/cvs/ports/Mk/bsd.port.mk	Sun Jan  2 18:42:08 2005
+++ bsd.port.mk	Sun Jan  2 22:14:56 2005
@@ -1044,15 +1044,42 @@
+# Options infrastructure definitions
 .if defined(OPTIONS)
-.if exists(${_OPTIONSFILE}) && !make(rmconfig)
-.include "${_OPTIONSFILE}"
-.if exists(${_OPTIONSFILE}.local)
-.include "${_OPTIONSFILE}.local"
+. if defined(PACKAGE_BUILDING)
+.  if defined(OPTIONS)
+.   for O in ${REALOPTIONS}
+.    if ${RO:L} == off
+.    endif
+.    if ${RO:L} == on
+WITH:=		${WITH} ${OPT}
+.    endif
+.   endfor
+.  endif
+.  for W in ${WITH}
+WITH_${W}:=	true
+.  endfor
+.  for W in ${WITHOUT}
+WITHOUT_${W}:=	true
+.  endfor
+. undef WITH
+. undef WITHOUT
+. undef RO
+. endif
+. if exists(${_OPTIONSFILE}) && !make(rmconfig)
+.  include "${_OPTIONSFILE}"
+. endif
+. if exists(${_OPTIONSFILE}.local)
+.  include "${_OPTIONSFILE}.local"
+. endif
 # check for old, crufty, makefile types, part 1:

More information about the freebsd-ports-bugs mailing list