niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Standardized make options (or no doesn't always mean no)
Post new topic   Reply to topic Page 1 of 2 [18 Posts] View previous topic :: View next topic
Goto page:  1, 2 Next
Author Message
Juli Mallett
*nix forums beginner


Joined: 12 Jun 2002
Posts: 22

PostPosted: Fri Jul 26, 2002 7:30 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

* De: Cyrille Lefevre <cyrille.lefevre@laposte.net> [ Data: 2002-07-26 ]
[ Subjecte: Re: Standardized make options (or no doesn't always mean no) ]
Quote:
Also, the diff seems reasonable, but you really do want to keep in mind
that most places where make(1) substitutes/expands variables, it will be
allocating memory. Leaks bad.

re you saying that almost all occurences of :

cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);

should really be :

cp2 = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);
free(cp);
cp = cp2;

No.

imagine...

static void
Parse_PrintLineWithSubst(cp)
char *cp;
{
cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);
fprintf(stderr, "%s\n", cp);
free(cp);
}

No need for a place-holder, sometimes.

Quote:
- /* use fprintf/exit instead of Parse_Error to terminate immediately */
- fprintf(stderr, "\"%s\", line %d: %s\n", fname, lineno, errmsg);
+ Parse_Error(PARSE_FATAL, "%s", errmsg);
exit(1);

This seems like a regression.

looking at Parse_Error, there is no reason here to use fprintf instead ?

You're right. I was thinking Parse_Error was slightly more heavyweight.
--
Juli Mallett <jmallett@FreeBSD.org> | FreeBSD: The Power To Serve
Will break world for fulltime employment. | finger jmallett@FreeBSD.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Cyrille Lefevre
*nix forums beginner


Joined: 12 Jun 2002
Posts: 48

PostPosted: Fri Jul 26, 2002 1:43 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Fri, Jul 26, 2002 at 08:25:27AM -0700, Juli Mallett wrote:
Quote:
* De: Cyrille Lefevre <cyrille.lefevre@laposte.net> [ Data: 2002-07-26 ]
[ Subjecte: Re: Standardized make options (or no doesn't always mean no) ]
On Thu, Jul 25, 2002 at 08:09:40PM +0300, Ruslan Ermilov wrote:
On Thu, Jul 25, 2002 at 06:59:40PM +0200, Cyrille Lefevre wrote:
On Thu, Jul 25, 2002 at 10:01:45AM +0300, Ruslan Ermilov wrote:
[snip]
We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

.warning isn't needed, let's try w/ .BEGIN :)

well, il fact, a .warning is needed for the newer knob because
it seems you can't do something like this :

Can't you use a double-colon rule to accomplish that?

I've also tried w/o success.

Quote:
Also, the diff seems reasonable, but you really do want to keep in mind
that most places where make(1) substitutes/expands variables, it will be
allocating memory. Leaks bad.

re you saying that almost all occurences of :

cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);

should really be :

cp2 = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);
free(cp);
cp = cp2;

Quote:
- /* use fprintf/exit instead of Parse_Error to terminate immediately */
- fprintf(stderr, "\"%s\", line %d: %s\n", fname, lineno, errmsg);
+ Parse_Error(PARSE_FATAL, "%s", errmsg);
exit(1);

This seems like a regression.

looking at Parse_Error, there is no reason here to use fprintf instead ?

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
Back to top
Cyrille Lefevre
*nix forums beginner


Joined: 12 Jun 2002
Posts: 48

PostPosted: Fri Jul 26, 2002 1:37 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Fri, Jul 26, 2002 at 03:59:23PM +0200, Cyrille Lefevre wrote:
[snip]
Quote:
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
Back to top
Juli Mallett
*nix forums beginner


Joined: 12 Jun 2002
Posts: 22

PostPosted: Fri Jul 26, 2002 1:25 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

* De: Cyrille Lefevre <cyrille.lefevre@laposte.net> [ Data: 2002-07-26 ]
[ Subjecte: Re: Standardized make options (or no doesn't always mean no) ]
Quote:
On Thu, Jul 25, 2002 at 08:09:40PM +0300, Ruslan Ermilov wrote:
On Thu, Jul 25, 2002 at 06:59:40PM +0200, Cyrille Lefevre wrote:
On Thu, Jul 25, 2002 at 10:01:45AM +0300, Ruslan Ermilov wrote:
[snip]
We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

.warning isn't needed, let's try w/ .BEGIN :)

well, il fact, a .warning is needed for the newer knob because
it seems you can't do something like this :

Can't you use a double-colon rule to accomplish that?

Also, the diff seems reasonable, but you really do want to keep in mind
that most places where make(1) substitutes/expands variables, it will be
allocating memory. Leaks bad.

juli.

Quote:
- /* use fprintf/exit instead of Parse_Error to terminate immediately */
- fprintf(stderr, "\"%s\", line %d: %s\n", fname, lineno, errmsg);
+ Parse_Error(PARSE_FATAL, "%s", errmsg);
exit(1);

This seems like a regression.
--
Juli Mallett <jmallett@FreeBSD.org> | FreeBSD: The Power To Serve
Will break world for fulltime employment. | finger jmallett@FreeBSD.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Cyrille Lefevre
*nix forums beginner


Joined: 12 Jun 2002
Posts: 48

PostPosted: Fri Jul 26, 2002 11:59 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Thu, Jul 25, 2002 at 08:09:40PM +0300, Ruslan Ermilov wrote:
Quote:
On Thu, Jul 25, 2002 at 06:59:40PM +0200, Cyrille Lefevre wrote:
On Thu, Jul 25, 2002 at 10:01:45AM +0300, Ruslan Ermilov wrote:
[snip]
We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

.warning isn't needed, let's try w/ .BEGIN Smile

well, il fact, a .warning is needed for the newer knob because
it seems you can't do something like this :

..for something
..BEGIN:
something
..endfor

nor

..for something
targets+= ${something}
pseudo_target:
something
..endfor

..BEGIN: ${something}

nor

..for something
pseudo_target: .USE
something
..endfor

..BEGIN: pseudo_target

[snip]
Quote:
I'll try to make another knob for variable conversion such as :
NOALIAS -> PPP_NO_ALIAS, etc.

here is the newer knob which is more universal than the first one +
some patches to make... also, a set of command to help the transition :)

OLDBAD= true
NEWGOOD=true
OLDWARN=true
NEWWARN=true
OLDERR= true
NEWERR= false

NOBAD= true
NO_GOOD=true
NOWARN= true
NO_WARN=true
NOERR= true
NO_ERR= false

_ASSOC_VARS= OLDBAD NEWBAD OLDGOOD NEWGOOD OLDWARN NEWWARN OLDERR NEWERR
_NO_VARS= BAD GOOD WARN ERR

..for _var in ${_NO_VARS}
_ASSOC_VARS+= NO${_var} NO_${_var}
..endfor

_old=
..for _new in ${_ASSOC_VARS}
.. if empty(_old)
_old= ${_new}
.. else
.. if defined(${_old})
.. if defined(${_new})
.. if ${${_old}} != ${${_new}}
.. warning both ${_new} and ${_old} are defined with a different value --\
using ${_new} and unsetting ${_old}.
.. else
.. warning both ${_new} and ${_old} are defined with the same value --\
using ${_new} and unsetting ${_old}.
.. endif
.. else
.. warning ${_new} should be defined in place of ${_old} --\
using ${_new} with the value of ${_old} and unsetting ${_old}.
${_new}:=${${_old}}
.. endif
.. undef ${_old}
.. endif
_old=
.. endif
..endfor

all:
@${ECHO_CMD} renamed variables
@${ECHO_CMD} BAD=${OLDBAD}:${NEWBAD}
@${ECHO_CMD} GOOD=${OLDGOOD}:${NEWGOOD}
@${ECHO_CMD} WARN=${OLDWARN}:${NEWWARN}
@${ECHO_CMD} ERR=${OLDERR}:${NEWERR}
@${ECHO_CMD} no variables
@${ECHO_CMD} BAD=${NOBAD}:${NO_BAD}
@${ECHO_CMD} GOOD=${NOGOOD}:${NO_GOOD}
@${ECHO_CMD} WARN=${NOWARN}:${NO_WARN}
@${ECHO_CMD} ERR=${NOERR}:${NO_ERR}

parce.c
saveline added to make lineno happy in `.for' loops.
ParseDoWarning added
Var_Subst added in `.undef' to avoid inconsistencies such as :
.for var in ${vars}
.undef ${var}
.endfor
vs.
.for var in ${vars}
tmp=${var}
.undef ${tmp}
.endfor

Index: parse.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/make/parse.c,v
retrieving revision 1.22
diff -u -r1.22 parse.c
--- parse.c 28 Aug 1999 01:03:35 -0000 1.22
+++ parse.c 26 Jul 2002 02:12:52 -0000
@@ -120,6 +120,7 @@

static char *fname; /* name of current file (for errors) */
static int lineno; /* line number in current file */
+static int savedlineno; /* saved line number */
static FILE *curFILE = NULL; /* current makefile */

static PTR *curPTR = NULL; /* current makefile */
@@ -252,6 +253,7 @@
static void ParseUnreadc __P((int));
static void ParseHasCommands __P((ClientData));
static void ParseDoInclude __P((char *));
+static void ParseDoWarning __P((char *));
static void ParseDoError __P((char *));
#ifdef SYSVINCLUDE
static void ParseTraditionalInclude __P((char *));
@@ -1557,6 +1559,33 @@
}

/*---------------------------------------------------------------------
+ * ParseDoWarning --
+ * Handle warning directive
+ *
+ * The input is the line minus the ".warning". We substitute variables
+ * and the message or print a warning if the ".warning" directive is
+ * malformed.
+ *
+ *---------------------------------------------------------------------
+ */
+static void
+ParseDoWarning(errmsg)
+ char *errmsg; /* error message */
+{
+ if (!isspace(*errmsg)) {
+ Parse_Error(PARSE_WARNING, "invalid syntax: .warning%s", errmsg);
+ return;
+ }
+
+ while (isspace(*errmsg))
+ errmsg++;
+
+ errmsg = Var_Subst(NULL, errmsg, VAR_GLOBAL, FALSE);
+
+ Parse_Error(PARSE_WARNING, "%s", errmsg);
+}
+
+/*---------------------------------------------------------------------
* ParseDoError --
* Handle error directive
*
@@ -1580,8 +1609,7 @@

errmsg = Var_Subst(NULL, errmsg, VAR_GLOBAL, FALSE);

- /* use fprintf/exit instead of Parse_Error to terminate immediately */
- fprintf(stderr, "\"%s\", line %d: %s\n", fname, lineno, errmsg);
+ Parse_Error(PARSE_FATAL, "%s", errmsg);
exit(1);
}

@@ -1801,7 +1829,7 @@
curFILE = NULL;
curPTR = (PTR *) emalloc (sizeof (PTR));
curPTR->str = curPTR->ptr = str;
- lineno = 0;
+ lineno = savedlineno;
fname = estrdup(fname);
}

@@ -2321,6 +2349,7 @@
if (For_Eval(line)) {
int ok;
free(line);
+ savedlineno = lineno;
do {
/*
* Skip after the matching end
@@ -2421,7 +2450,10 @@
goto nextLine;
} else if (strncmp (cp, "error", 5) == 0) {
ParseDoError(cp + 5);
- goto nextLine;
+ /* NOTREACHED */
+ } else if (strncmp (cp, "warning", 7) == 0) {
+ ParseDoWarning(cp + 7);
+ goto nextLine;
} else if (strncmp(cp, "undef", 5) == 0) {
char *cp2;
for (cp += 5; isspace((unsigned char) *cp); cp++) {
@@ -2434,6 +2466,8 @@
}

*cp2 = '\0';
+
+ cp = Var_Subst(NULL, cp, VAR_GLOBAL, FALSE);

Var_Delete(cp, VAR_GLOBAL);
goto nextLine;

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

hope this help :)

PS : about the make patch, I could submit a PR if you prefer ?

CC -jmallett

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
Back to top
Ruslan Ermilov
*nix forums addict


Joined: 01 Jul 2002
Posts: 65

PostPosted: Thu Jul 25, 2002 3:09 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Thu, Jul 25, 2002 at 06:59:40PM +0200, Cyrille Lefevre wrote:
Quote:
On Thu, Jul 25, 2002 at 10:01:45AM +0300, Ruslan Ermilov wrote:
On Sun, Jun 09, 2002 at 12:42:59PM +1000, Bruce Evans wrote:
On Sat, 8 Jun 2002, Doug Barton wrote:
Mike Barcroft wrote:
Is anyone planning to do something about the hugely confusing state of
NO/NO_ options? I can never remember which options have an underscore
after the NO, so I end up writing commands like
`make kernel ... NO_KERNELCLEAN=true NOKERNELCLEAN=true'. It would
very nice if we could standardize this and add some compatibility
shims for historical spellings.

In the past versions of this conversation, the general agreement is that
going forward we should probably standardize on underscores to seperate
words. So, NO_FOO rather than NOFOO. However, no_volunteer has come
forward to do the work you've described, so if you're volunteering.....
:)

On my list of things to fix after the changing the spelling of "nothing"
to "no thing". Smile :-)

I'd volunteer to do it if we could come up to a (violent) agreement.

We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

.warning isn't needed, let's try w/ .BEGIN :)

NOBAD= true
NO_GOOD=true
NOWARN= true
NO_WARN=true
NOERR= true
NO_ERR= false

_NO_VARS= BAD GOOD WARN ERR TOTO

.BEGIN:
.for var in ${_NO_VARS}
.if defined(NO${var})
. if defined(NO_${var})
. if ${NO${var}} != ${NO_${var}}
# maybe this should be a .error ?
@${ECHO_CMD} "warning: both NO_${var} and NO${var} are defined and" \
"have different values -- using NO_${var} and unsetting NO${var}."
. else
@${ECHO_CMD} "warning: both NO_${var} and NO${var} are defined" \
"-- using NO_${var} and unsetting NO${var}."
. endif
. else
@${ECHO_CMD} "warning: NO_${var} should be defined in place of NO${var}" \
"-- setting NO_${var} as NO${var} and unsetting NO${var}."
. endif
.endif
.endfor

.for var in ${_NO_VARS}
.if defined(NO${var})
. if !defined(NO_${var})
NO_${var}:=${NO${var}}
. endif
. undef NO${var}
.endif
.endfor

all:
@${ECHO_CMD} BAD=${NOBAD}:${NO_BAD}
@${ECHO_CMD} GOOD=${NOGOOD}:${NO_GOOD}
@${ECHO_CMD} WARN=${NOWARN}:${NO_WARN}
@${ECHO_CMD} ERR=${NOERR}:${NO_ERR}

a non-exhaustive list of NO[^_] variable is :

NOTAGS NODOCCOMPRESS NOINFO NOINFOCOMPRESS NOPIC NOPROFILE NOEXTRADEPEND
NOFCSCHG NOSHARED NOMAN NOMANCOMPRESS NOMLINKS NOOBJ NOSGMLCOMPRESS
NOCLEAN NOCLEANDIR NOMAN NOGAMES NOPERL NOLIBC_R NOHTML NODOC
NOKERBEROS NOPORTREADMES NOPORTS NOSRC NODESCRYPTLINKS NOCRYPT
NOSECURE NOSHARE NOFORTH NOLIB NOPAM NOUUCP NOALIAS NOI4B NOINET6
NOKLDLOAD NONAT NONETGRAPH NORADIUS NOSUID NOIPSEC

I'll try to make another knob for variable conversion such as :
NOALIAS -> PPP_NO_ALIAS, etc.

I would personally prefer the NO_FOOs since these would make things
more readable and disambiguate the things like NORMAL, NOTES, NODES.
What's NODES? node(s) or "no DES"? :-)

agreed.

Sounds like a plan. Smile



Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
Cyrille Lefevre
*nix forums beginner


Joined: 12 Jun 2002
Posts: 48

PostPosted: Thu Jul 25, 2002 2:59 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Thu, Jul 25, 2002 at 10:01:45AM +0300, Ruslan Ermilov wrote:
Quote:
On Sun, Jun 09, 2002 at 12:42:59PM +1000, Bruce Evans wrote:
On Sat, 8 Jun 2002, Doug Barton wrote:
Mike Barcroft wrote:
Is anyone planning to do something about the hugely confusing state of
NO/NO_ options? I can never remember which options have an underscore
after the NO, so I end up writing commands like
`make kernel ... NO_KERNELCLEAN=true NOKERNELCLEAN=true'. It would
very nice if we could standardize this and add some compatibility
shims for historical spellings.

In the past versions of this conversation, the general agreement is that
going forward we should probably standardize on underscores to seperate
words. So, NO_FOO rather than NOFOO. However, no_volunteer has come
forward to do the work you've described, so if you're volunteering....
:)

On my list of things to fix after the changing the spelling of "nothing"
to "no thing". Smile :-)

I'd volunteer to do it if we could come up to a (violent) agreement.

We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

..warning isn't needed, let's try w/ .BEGIN :)

NOBAD= true
NO_GOOD=true
NOWARN= true
NO_WARN=true
NOERR= true
NO_ERR= false

_NO_VARS= BAD GOOD WARN ERR TOTO

..BEGIN:
..for var in ${_NO_VARS}
..if defined(NO${var})
.. if defined(NO_${var})
.. if ${NO${var}} != ${NO_${var}}
# maybe this should be a .error ?
@${ECHO_CMD} "warning: both NO_${var} and NO${var} are defined and" \
"have different values -- using NO_${var} and unsetting NO${var}."
.. else
@${ECHO_CMD} "warning: both NO_${var} and NO${var} are defined" \
"-- using NO_${var} and unsetting NO${var}."
.. endif
.. else
@${ECHO_CMD} "warning: NO_${var} should be defined in place of NO${var}" \
"-- setting NO_${var} as NO${var} and unsetting NO${var}."
.. endif
..endif
..endfor

..for var in ${_NO_VARS}
..if defined(NO${var})
.. if !defined(NO_${var})
NO_${var}:=${NO${var}}
.. endif
.. undef NO${var}
..endif
..endfor

all:
@${ECHO_CMD} BAD=${NOBAD}:${NO_BAD}
@${ECHO_CMD} GOOD=${NOGOOD}:${NO_GOOD}
@${ECHO_CMD} WARN=${NOWARN}:${NO_WARN}
@${ECHO_CMD} ERR=${NOERR}:${NO_ERR}

a non-exhaustive list of NO[^_] variable is :

NOTAGS NODOCCOMPRESS NOINFO NOINFOCOMPRESS NOPIC NOPROFILE NOEXTRADEPEND
NOFCSCHG NOSHARED NOMAN NOMANCOMPRESS NOMLINKS NOOBJ NOSGMLCOMPRESS
NOCLEAN NOCLEANDIR NOMAN NOGAMES NOPERL NOLIBC_R NOHTML NODOC
NOKERBEROS NOPORTREADMES NOPORTS NOSRC NODESCRYPTLINKS NOCRYPT
NOSECURE NOSHARE NOFORTH NOLIB NOPAM NOUUCP NOALIAS NOI4B NOINET6
NOKLDLOAD NONAT NONETGRAPH NORADIUS NOSUID NOIPSEC

I'll try to make another knob for variable conversion such as :
NOALIAS -> PPP_NO_ALIAS, etc.

Quote:
I would personally prefer the NO_FOOs since these would make things
more readable and disambiguate the things like NORMAL, NOTES, NODES.
What's NODES? node(s) or "no DES"? Smile

agreed.

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
Back to top
Ruslan Ermilov
*nix forums addict


Joined: 01 Jul 2002
Posts: 65

PostPosted: Thu Jul 25, 2002 5:01 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Sun, Jun 09, 2002 at 12:42:59PM +1000, Bruce Evans wrote:
Quote:
On Sat, 8 Jun 2002, Doug Barton wrote:

Mike Barcroft wrote:

Is anyone planning to do something about the hugely confusing state of
NO/NO_ options? I can never remember which options have an underscore
after the NO, so I end up writing commands like
`make kernel ... NO_KERNELCLEAN=true NOKERNELCLEAN=true'. It would
very nice if we could standardize this and add some compatibility
shims for historical spellings.

In the past versions of this conversation, the general agreement is that
going forward we should probably standardize on underscores to seperate
words. So, NO_FOO rather than NOFOO. However, no_volunteer has come
forward to do the work you've described, so if you're volunteering....
:)

On my list of things to fix after the changing the spelling of "nothing"
to "no thing". Smile :-)

I'd volunteer to do it if we could come up to a (violent) agreement.


We'd provide the compatibility knobs that would also trigger a warning
(a .warning to be added to make(1)) that NO_FOO should now be used
instead of NOFOO (or vice versa, if we decide to go that way).

I would personally prefer the NO_FOOs since these would make things
more readable and disambiguate the things like NORMAL, NOTES, NODES.
What's NODES? node(s) or "no DES"? :-)


Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Fri Jun 14, 2002 6:47 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

In message: <20020609101333.A26546@dragon.nuxi.com>
"David O'Brien" <obrien@FreeBSD.ORG> writes:
: [please take care to NOT CC me, I do read arch@]
:
: On Sun, Jun 09, 2002 at 12:27:25AM -0700, Marcel Moolenaar wrote:
: > Also, I believe in earlier discussions NO_BLA was in favor by most of
: > the people involved, but I can be wrong here (too).
:
: You are correct. I estimate this discussion was 2 years ago now.
: Everyone except BDE (and maybe a few others) wanted NOFOO, all the rest
: wanted NO_FOO. In June 2000, Kris Kennaway made a set of patches to
: change most everything to NO_.

I think you ment that everybody wanted NO_FOO, except bde and a couple
others. They wanted to retain the traditional NOFOO.

NO_FOO is the new standard. We didn't do the cutover in 2000 because
it was deemed too disruptive for folks that have 4.x and current
builds on the same box. With the ability to set make.conf on a
per-build basis now, that's a moot point. I can see no real reason
for not completing the cutover, except manpower.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 09 Jun 2002
Posts: 1

PostPosted: Sun Jun 09, 2002 3:13 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

[please take care to NOT CC me, I do read arch@]

On Sun, Jun 09, 2002 at 12:27:25AM -0700, Marcel Moolenaar wrote:
Quote:
Also, I believe in earlier discussions NO_BLA was in favor by most of
the people involved, but I can be wrong here (too).

You are correct. I estimate this discussion was 2 years ago now.
Everyone except BDE (and maybe a few others) wanted NOFOO, all the rest
wanted NO_FOO. In June 2000, Kris Kennaway made a set of patches to
change most everything to NO_.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
John Hay
*nix forums beginner


Joined: 17 Apr 2002
Posts: 8

PostPosted: Sun Jun 09, 2002 7:51 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

Quote:

Is anyone planning to do something about the hugely confusing state of
NO/NO_ options? I can never remember which options have an underscore
after the NO, so I end up writing commands like
`make kernel ... NO_KERNELCLEAN=true NOKERNELCLEAN=true'. It would
very nice if we could standardize this and add some compatibility
shims for historical spellings.

There were standards a long time ago, but just like some people like to
ignore style(9), this was also ignored and we end up confused. Sad My
vote would be for NOFOO (because that was the standard), but that is
just my vote. And yes I think it is a good idea that we should have it
standarized, but then I also think our code should conform to style(9).
:-)

John
--
John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Marcel Moolenaar
*nix forums Guru Wannabe


Joined: 03 Apr 2002
Posts: 120

PostPosted: Sun Jun 09, 2002 5:27 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Sat, Jun 08, 2002 at 10:32:49PM -0700, Terry Lambert wrote:
Quote:

Hysterical raisins. BLAH=anythingatall has always meant, "BLAH is true,"
(or more properly, BLAH is defined) regardless of the value. Your way
would make more sense, but that's a battle I'm not willing to fight.

Since everyone appears to be in the mood to hack "Make" these days, it
might be worthwhile to add a "-U<name>" option, jut like "cc" has?

I interpreted -U<name> as meaning the interface as preferred by user
"name", before I reached "ju(s)t like "cc" has". Since the latter is
only a comma away from the former, I think it's save to say that it's
a genuine signal. I've yet to decode the signal, though :-)

AFAICT, NOFOO has been the convention and it got polluted with NO_BAR.
I'm of the impression that it came from the ports collection, was this
the case?

Also, I believe in earlier discussions NO_BLA was in favor by most of
the people involved, but I can be wrong here (too).

I can't even remember if I was part of that discussion and what my
opinion was at that time, but this time it's that I prefer NOFOO.
Maybe because I had to type NO_WERROR so often, but more likely
because NOFOO fits the BSD paradigm so much better.

In any way: the inconsistency is worse than either naming scheme.
So I will see it as an improvement even if it's not my preferred
naming...

--
Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Terry Lambert
*nix forums Guru


Joined: 19 Mar 2002
Posts: 434

PostPosted: Sun Jun 09, 2002 3:32 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

Doug Barton wrote:
Quote:
Terry Lambert wrote:
How about "FOO=false" and "FOO=true" and "NO_FOO: undefined variable"?

Hysterical raisins. BLAH=anythingatall has always meant, "BLAH is true,"
(or more properly, BLAH is defined) regardless of the value. Your way
would make more sense, but that's a battle I'm not willing to fight.

Since everyone appears to be in the mood to hack "Make" these days, it
might be worthwhile to add a "-U<name>" option, jut like "cc" has?

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Bruce Evans
*nix forums Guru Wannabe


Joined: 22 Mar 2002
Posts: 190

PostPosted: Sun Jun 09, 2002 2:42 am    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

On Sat, 8 Jun 2002, Doug Barton wrote:

Quote:
Mike Barcroft wrote:

Is anyone planning to do something about the hugely confusing state of
NO/NO_ options? I can never remember which options have an underscore
after the NO, so I end up writing commands like
`make kernel ... NO_KERNELCLEAN=true NOKERNELCLEAN=true'. It would
very nice if we could standardize this and add some compatibility
shims for historical spellings.

In the past versions of this conversation, the general agreement is that
going forward we should probably standardize on underscores to seperate
words. So, NO_FOO rather than NOFOO. However, no_volunteer has come
forward to do the work you've described, so if you're volunteering....
Smile

On my list of things to fix after the changing the spelling of "nothing"
to "no thing". Smile :-)

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Doug Barton
*nix forums addict


Joined: 24 Apr 2002
Posts: 91

PostPosted: Sat Jun 08, 2002 11:33 pm    Post subject: Re: Standardized make options (or no doesn't always mean no) Reply with quote

Terry Lambert wrote:

Quote:
How about "FOO=false" and "FOO=true" and "NO_FOO: undefined variable"?

Hysterical raisins. BLAH=anythingatall has always meant, "BLAH is true,"
(or more properly, BLAH is defined) regardless of the value. Your way
would make more sense, but that's a battle I'm not willing to fight.

Doug

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

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 2 [18 Posts] Goto page:  1, 2 Next
View previous topic :: View next topic
The time now is Thu Jan 08, 2009 5:46 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts make printer network available Johann Höchtl networking 0 Fri Jul 21, 2006 9:01 am
No new posts Problems with make-kpkg and skas patch Todd A. Jacobs Debian 0 Fri Jul 21, 2006 12:30 am
No new posts Dev Database Refresh Options meathammer Server 3 Wed Jul 19, 2006 10:05 pm
No new posts Make an updates disk? Cameron L. Spitzer Debian 1 Wed Jul 19, 2006 6:40 pm
No new posts Possible bug? Httpd Make error on Solaris 10 Dan Richardson Apache 2 Wed Jul 19, 2006 1:37 pm

Free Advertising | Personal Finance | Loans | Loans | Recreation websites directory
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2580s ][ Queries: 16 (0.0719s) ][ GZIP on - Debug on ]