Le 03/09/2017 à 16:51, Matthew Seaman a écrit : > On 03/09/2017 05:57, Yuri wrote: >> This doesn't work: >> >>> .include <bsd.port.options.mk> >>> >>> .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000 >>> OPTIONS_DEFAULT+= MYOPT >>> .endif >> MYOPT isn't picked up >> >> >> I tried with a regular expressions, witout .include: >>> SYSVERSION= ${OPSYS}${OSVERSION} >>> OPTIONS_DEFAULT=HELP >>> ${SYSVERSION:C/^FreeBSD1[1-9][0-9]{5}$/MYOPT/:MMYOPT} >> MYOPT isn't picked up again. >> > If you're referring to $OPSYS or $OSVERSION then you'll want to > put that section of code after > > .include <bsd.port.pre.mk> > > and obviously change the last line in your Makefile to > > .include <bsd.port.post.mk>
But you cannot define any OPTIONS_* variables after including bsd.port.options.mk (which happen about in the middle of what bsd.port.pre.mk does.) The thing that people who want to do something like this usually do is an ugly: OPTIONS_DEFAULT= FOO BAR ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}} OPTIONS_DEFAULT_FreeBSD_10= BAZ It is usually a bad idea, why are you trying to do this ? -- Mathieu Arnold
signature.asc
Description: OpenPGP digital signature