tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

disabling unsupported options

In my mk.conf I turn off various options with PKG_OPTIONS.pkg+= -foo.
If a package uses the options variable PKG_OPTIONS.pkg, though, and
does not support the option `foo', this makes it fail to build, which
seems awfully silly.

For example, I have PKG_OPTIONS.mplayer+= -mplayer-real to disable
proprietary codecs -- but since that option is supported only on i386,
powerpc, and alpha, mplayer fails to build on amd64 with that setting,
even though I'm turning it off.

Any objections to the following patch to stop failing packages because
the user disabled options that aren't supported?

Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.67
diff -p -u -r1.67
--- mk/   18 Feb 2008 14:30:40 -0000      1.67
+++ mk/   16 Jan 2013 06:55:01 -0000
@@ -284,7 +284,7 @@ _opt_:=             ${_popt_}
 _opt_:=                -${_popt_}
 .    endif
 .  endif
-.  if empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
+.  if empty(_opt_:M-*) && empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
 .  else
 .    if defined(_PKG_OPTIONS_GROUP_MAP.${_popt_})

Home | Main Index | Thread Index | Old Index