Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jul 2002 17:37:01 +0200
From:      Cyrille Lefevre <cyrille.lefevre@laposte.net>
To:        Ruslan Ermilov <ru@FreeBSD.ORG>
Cc:        Bruce Evans <bde@zeta.org.au>, Doug Barton <DougB@FreeBSD.ORG>, Mike Barcroft <mike@FreeBSD.ORG>, arch@FreeBSD.ORG, Juli Mallett <jmallett@FreeBSD.ORG>
Subject:   Re: Standardized make options (or no doesn't always mean no)
Message-ID:  <20020726153701.GA93459@gits.dyndns.org>
In-Reply-To: <20020726135923.GA89959@gits.dyndns.org>
References:  <3D02AB11.F373AB4@FreeBSD.org> <20020609123557.X21758-100000@gamplex.bde.org> <20020725070145.GE56367@sunbay.com> <20020725165940.GF58642@gits.dyndns.org> <20020725170940.GA40574@sunbay.com> <20020726135923.GA89959@gits.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 26, 2002 at 03:59:23PM +0200, Cyrille Lefevre wrote:
[snip]
> find . -name 'Makefile*' -o -name 'bsd.*.mk' |
> egrep -v '[./](new|old)[/:]' |
> xargs egrep '(^\. *if(n?def)|defined) *\(?NO[^_]' /dev/null >| /tmp/no1
> sed -E -e 's/\.if(n?def)? //;s/exists *([^)]+)//g;s/ *[|&=][|&=] *//g' \
>        -e 's/!? *defined//g;s/[()\\"]/ /g;s/\${MACHINE_ARCH}//g' \
>        -e 's/ i386//g;s/alpha//g;s/:/ /g;s/ +/ /g;s|^\./||' /tmp/no1 >| /tmp/no2
> awk '{for(i=2;i<=NF;i++)if($i~/^NO[^_]/)print $1,$i}' /tmp/no2 |
> sort -u >| /tmp/no3
> awk '{for(i=2;i<=NF;i++)if($i~/^NO[^_]/)print $i,$1}' /tmp/no2 |
> sort -u >| /tmp/no4
> awk '$1!=f{if(f)print f;f=$1;printf "sed -E -i.bak"}
>      {v=$2;sub("NO","&_",v);
>       printf " -e %cs/%s([^A-Z_]|$)/%s\\1/g%c ", 39, $2, v, 39}
>      END{print f}' /tmp/no3 >| /tmp/no5
> awk '$1!=v{if(v){sub("NO","",v);print "_NO_VARS+=\t"v};v=$1}
>      {print "#", $2}
>      END{sub("NO","",v);print "_NO_VARS+=\t"v}' /tmp/no4 >| /tmp/no6
> sed -E -e 's/([^A-Z_])(ALIAS|I4B|KLDLOAD|NAT|NETGRAPH|RADIUS|SUID)([^A-Z_]|$)/\1NO\2	PPP_NO\2\3/' \
>        -e 't e' -e b -e :e -e 's/_NO_VARS/_ASSOC_VARS/' /tmp/no6 >| /tmp/no7
> 
> no5 contains the sed commands to replace every occurences of NOFOO
>     to NO_FOO in every files
> no6 contains the list (_NO_VARS) of NO variables for the above knob
> no7 same a no6 except that NOFOO ppp variables have been renamed to PPP_NOFOO
>     and put in _ASSOC_VARS

forgive me about no7, let's PPP vars as they are.

oops! forgot about var assignments...

egrep -v '[./](new|old|obsolete|bak[1-9])[/:]' |
xargs egrep "^( *# *)?NO[^_]+" /dev/null |
# NOINSTALLLIB is obsolete -- found in ./lib/libpam/modules/Makefile.inc
egrep -v 'NORMAL|NOTES?:|NOLIGFLAG|NOVARARGS|NONAP|NOLOG|NOASM|NOINSTALLLIB|NOTYET|NOPUSH' >| /tmp/no11
sed -E -e 's|^\./||;s/[+?:!]?=.*//;s/[#:]/ /g;s/ +/ /g' /tmp/no11 >| /tmp/no22
awk '{for(i=2;i<=NF;i++)if($i~/^NO[^_]/)print $1,$i}' /tmp/no22 |
sort -u >| /tmp/no33
awk '{for(i=2;i<=NF;i++)if($i~/^NO[^_]/)print $i,$1}' /tmp/no22 |
sort -u >| /tmp/no44
awk '$1!=f{if(f)print f;f=$1;printf "sed -E -i.bak2"}
     {v=$2;sub("NO","&_",v);
      printf " -e %cs/%s([^A-Z_]|$)/%s\\1/g%c ", 39, $2, v, 39}
     END{print f}' /tmp/no33 >| /tmp/no55
awk '$1!=v{if(v){sub("NO","",v);print "_NO_VARS+=\t"v};v=$1}
     {print "#", $2}
     END{sub("NO","",v);print "_NO_VARS+=\t"v}' /tmp/no44 >| /tmp/no66

no55 contains the sed commands to replace every occurences of NOFOO=
     to NO_FOO in every files
no66 same as no6 but, for info only

wait some time the build world finish... and I'll send you THE diff :)

Cyrille.
-- 
Cyrille Lefevre                 mailto:cyrille.lefevre@laposte.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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