OpenBSD CVS

CVS log for src/usr.bin/make/var.c


[BACK] Up to [local] / src / usr.bin / make

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.106 / (download) - annotate - [select for diffs], Mon Sep 4 11:35:11 2023 UTC (8 months, 2 weeks ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.105: +1 -2 lines
Diff to previous 1.105 (colored)

GC old code that was originally implemented to facilitate adoption by
other BSDs, which never happened, so make things simpler for further
development.

Ditches config.h entirely since it gets reduced to 2 defines.

okay tb@

Revision 1.105 / (download) - annotate - [select for diffs], Thu Aug 10 10:52:43 2023 UTC (9 months, 1 week ago) by espie
Branch: MAIN
Changes since 1.104: +65 -9 lines
Diff to previous 1.104 (colored)

Add support for .VARIABLES, to which I have use.
This is an extension but also exists in gnu-make.
okay millert@, kn@, thfr@
(I've added an XXX comment on top of the patch you've seen,
no actual further code change)

Revision 1.104 / (download) - annotate - [select for diffs], Thu Jun 9 13:13:14 2022 UTC (23 months, 1 week ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.103: +5 -2 lines
Diff to previous 1.103 (colored)

point developers to the other place where the remaining flags values are
defined (nice gotcha when you come back to the code after a few months).

Revision 1.103 / (download) - annotate - [select for diffs], Sun Dec 22 09:26:23 2019 UTC (4 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.102: +4 -4 lines
Diff to previous 1.102 (colored)

we also have "VAR_*" constants in parsevar with totally different meanings.
Rename to avoid ambiguity
- VAR_IS_SHELL (in var.c): the SHELL variable, which has specific
POSIX semantics
- VAR_SHELL (in parsevar.c): assign the result of running the command
to the variable.

no actual code change

Revision 1.102 / (download) - annotate - [select for diffs], Sat Dec 21 15:31:54 2019 UTC (4 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored)

yet another mostly cosmetic diff
- rename context into localvars, which is more meaningful and less generic
- instantiate the random rumbling at the start of gnode.h with actual
variable names
- explain and group gnode.h variables better
- make some comments terser/more meaningful

okay millert@

Revision 1.101 / (download) - annotate - [select for diffs], Sun Oct 23 14:54:14 2016 UTC (7 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.100: +23 -4 lines
Diff to previous 1.100 (colored)

add !!=
feedback and okay millert@

Revision 1.100 / (download) - annotate - [select for diffs], Fri Oct 14 09:27:21 2016 UTC (7 years, 7 months ago) by natano
Branch: MAIN
Changes since 1.99: +19 -5 lines
Diff to previous 1.99 (colored)

Implement the ${<D} and ${<F} variables, as documented in the manual.
They are equivalent to ${<:H} and ${<:T} repectively, however the former
variants are more portable, as they are understood by GNU, FreeBSD and
NetBSD make too.

absence of those variables reported by Dario Niedermann <dnied at tiscali.it>
ok millert espie

Revision 1.99 / (download) - annotate - [select for diffs], Sun Sep 27 16:58:16 2015 UTC (8 years, 7 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

Mark all the error printing functions as printf-like; fix two format
mismatches this revealed

ok espie@

Revision 1.98 / (download) - annotate - [select for diffs], Mon May 12 19:11:19 2014 UTC (10 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

adjust to ohash being in libutil now, and to the interface changes.
fix potential integer overflows in memory allocation (mostly for pedagogical
purposes, these are unlikely to overflow in practice)
move the rest of lst.lib stuff into its own directory.

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jan 29 23:53:20 2014 UTC (10 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

I'm a bit dyslexic. Found out by Jan Klemkow. Thanks.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Jan 6 12:15:40 2014 UTC (10 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.95: +13 -3 lines
Diff to previous 1.95 (colored)

this actually requires a comment. I would never have figured it out if
it wasn't for the arm error.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Jan 6 12:08:18 2014 UTC (10 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.94: +36 -19 lines
Diff to previous 1.94 (colored)

fix error messages, avoid dereferencing null pointers.
- the code becomes too indented, pull it into a separate function
- add an extra hint, the current_gnode.
- specifically, variables may be expanded during
target: prereq  solving in Suff_FindDeps, this is after parsing,
not during command execution, and the only actual indication with have is
that we're resolving a prereq of.

(this ought to fix mk35, and partially solve mk34)

Revision 1.94 / (download) - annotate - [select for diffs], Tue Apr 23 14:32:53 2013 UTC (11 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

remove TIMESTAMP abstraction layer, prodded by theo.
while there, clean up includes.
use strtoll for ar timestamps (pretty much unused in reality, more
standard conforming than anything)

use idea from Todd to adapt to time_t being 32 bits OR 64 bits
(pedantically correct: INT_MIN would work just fine up to 1910 or so...)

okay millert@, gone thru a make build.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Feb 15 18:34:25 2013 UTC (11 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.92: +11 -1 lines
Diff to previous 1.92 (colored)

turns out if a line ends with a $, the var module will run off the cliff
while expanding it.
shows up very prominently with MALLOC_OPTIONS=S

Problem found by jasper@

okay'd by jasper@ and kind-of duh'd by miod@

Revision 1.92 / (download) - annotate - [select for diffs], Tue Oct 9 19:39:59 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.91: +68 -1 lines
Diff to previous 1.91 (colored)

new interface: look in command lines for variables that indicate a list of
targets is actually separate targets.

Revision 1.91 / (download) - annotate - [select for diffs], Tue Oct 2 10:29:31 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.90: +61 -41 lines
Diff to previous 1.90 (colored)

more changes, discussed and tested by various people.
- put back some job control, turns out it's necessary when we don't run a
shell.
- zap old #ifdef CLEANUP code... probably doesn't even compile.
- kill most of the OP_LIB code. Just keep a wee little bit for compatibility
(deprecated .LIBS and .INCLUDES, warns for weird dependencies instead of
erroring out).
- much improved debugging and -p output: sort variables, targets, rules,
output stuff in a nicer format mimicing input.
- better error message when no command is found, explain where the target comes from.
- sort final error list by file.
- show system files in errors as <bsd.prog.mk>
- reincorporate random delay, that was dropped
- optimize siginfo output by not regenerating the whole string each time.
- finish zapping old LocationInfo field that's no longer used.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Aug 25 08:12:56 2012 UTC (11 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.89: +5 -4 lines
Diff to previous 1.89 (colored)

- make wrong variable specs (unterminated) parse errors.
- add info to be able to pinpoint parse errors at runtime.
- let job runners abort when a parse error happens while expanding a variable
during execution
- fix an infinite loop when compiling without FEATURE_RECVARS.

okay millert@, krw@
the very few errors found out by this (less than 10 over src/X/ports)
fixed trivially beforehand, as requested by deraadt@

Revision 1.89 / (download) - annotate - [select for diffs], Thu Mar 22 13:47:12 2012 UTC (12 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.88: +4 -3 lines
Diff to previous 1.88 (colored)

minor cleanup: error messages include lineno and fileno together, so
recognize that and create a struct Location_ for it.

mostly from Jonathan Calmels, a few nits from me.

okay otto@

Revision 1.88 / (download) - annotate - [select for diffs], Mon Jun 20 19:05:33 2011 UTC (12 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.87: +9 -4 lines
Diff to previous 1.87 (colored)

fix a segfault found by jasper@
ok miod@, otto@, jasper@

Revision 1.87 / (download) - annotate - [select for diffs], Mon Jul 19 19:46:44 2010 UTC (13 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.86: +1 -2 lines
Diff to previous 1.86 (colored)

Correct $OpenBSD$ stuff

Revision 1.86 / (download) - annotate - [select for diffs], Sun Apr 25 13:59:53 2010 UTC (14 years ago) by espie
Branch: MAIN
Changes since 1.85: +1 -1 lines
Diff to previous 1.85 (colored)

pure whitespace cleanup

Revision 1.85 / (download) - annotate - [select for diffs], Wed May 13 10:47:54 2009 UTC (15 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.84: +7 -1 lines
Diff to previous 1.84 (colored)

fix loopvar debug prints. Issue reported by naddy@

Revision 1.84 / (download) - annotate - [select for diffs], Sun Nov 9 12:34:47 2008 UTC (15 years, 6 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

typo fixed (overriden -> overridden)

ok espie, jmc

Revision 1.83 / (download) - annotate - [select for diffs], Sat Nov 17 16:39:45 2007 UTC (16 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.82: +34 -95 lines
Diff to previous 1.82 (colored)

simplify dynamic variable handling a great deal:
first remove all usage of Varq_Append by building the string directly.
then replace `common' handling with specialized handling for dynamic
strings (since they no longer need a buffer). Finally, identify the place
where the variable value needs to be copied because it's going to be free'd
or erased soon, and finally, use simple char* pointers.

Shaves about 80 bytes off every gnode structure, and kills quite a few
unnecessary malloc()s as well.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Nov 4 09:31:57 2007 UTC (16 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.81: +5 -5 lines
Diff to previous 1.81 (colored)

prevent gcc from complaining

Revision 1.81 / (download) - annotate - [select for diffs], Sat Nov 3 15:42:10 2007 UTC (16 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.80: +2 -1 lines
Diff to previous 1.80 (colored)

fix some lint FALLTHROUGH

Revision 1.80 / (download) - annotate - [select for diffs], Mon Sep 17 10:39:33 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.79: +6 -6 lines
Diff to previous 1.79 (colored)

more blank space removal

Revision 1.79 / (download) - annotate - [select for diffs], Mon Sep 17 09:45:37 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

more zap spaces

Revision 1.78 / (download) - annotate - [select for diffs], Mon Sep 17 09:44:20 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

zap more spaces at end of line

Revision 1.77 / (download) - annotate - [select for diffs], Mon Sep 17 09:28:36 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.76: +10 -10 lines
Diff to previous 1.76 (colored)

kill extra spaces at end of line

Revision 1.76 / (download) - annotate - [select for diffs], Sun Sep 16 12:01:11 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.75: +1 -2 lines
Diff to previous 1.75 (colored)

remove warnings

Revision 1.75 / (download) - annotate - [select for diffs], Sun Sep 16 09:46:14 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.74: +0 -0 lines
Diff to previous 1.74 (colored)

remove dead code: #define RECHECK is always on

Revision 1.74 / (download) - annotate - [select for diffs], Mon Jul 30 10:03:11 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.73: +17 -0 lines
Diff to previous 1.73 (colored)

introduce a Var_Substi to substitute on intervals.
Since we don't really know how to change Var_Subst and dependent functions,
we cheat, and copy the string to a buffer instead.

Clean-up the parser a bit: reorganize the include files lookup function:
introduce a resolve_include_filename function that figures out the full name
of the file, introduce a handle_include_file that does all the include file
handling, and rename the functions into handle_xxx_include, so that we
can remove most comments.

Rename ParseIsCond into handle_bsd_command, cut most of its code into
constituent functions.

Semantic changes:
- follow the rules that, if an optional construct does not parse correctly,
then it's not a real extension, and give the normal parser a chance to figure
it out. If the syntax checks out, semantic errors ARE real errors.
- allow variables to not be defined in include file names, no reason not to.

okay miod@

Revision 1.73 / (download) - annotate - [select for diffs], Mon Jul 30 09:51:53 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.72: +6 -3 lines
Diff to previous 1.72 (colored)

everywhere except in Var_Parse, we always add/append variables to the
VAR_GLOBAL context, so make it the common case: rename the basic functions
to Var_Set_with_ctxt/Var_Append_with_ctxt, define Var_Set and Var_Append
as macros that specify VAR_GLOBAL, and use these.

okay miod@

Revision 1.72 / (download) - annotate - [select for diffs], Mon Jul 30 09:47:21 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.71: +28 -26 lines
Diff to previous 1.71 (colored)

now that it's clean enough, one can extract some common code from
Var_Parse and Var_ParseSkip (the code that figures out the variable name
up to eventual modifiers).

okay miod@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jul 24 19:00:17 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.70: +1 -2 lines
Diff to previous 1.70 (colored)

zap unused variable

Revision 1.70 / (download) - annotate - [select for diffs], Tue Jul 24 18:58:48 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.69: +45 -58 lines
Diff to previous 1.69 (colored)

simplify computations in the var module: instead of advancing a char *
and keeping track of a length, we just advance the char *, and ditch
the length. We can still get the length at the end of the top-level
functions to satisfy existing interfaces.

Much simpler code, less error-prone.

Okay millert@

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jul 24 18:56:15 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.68: +78 -32 lines
Diff to previous 1.68 (colored)

move the code that grabs a value in Var_Parse in its own function,
get_expanded_value.

Extend the code a bit to be much more thorough in case of a recursive
expansion: shows exactly the cycle of variable names involved.

okay millert@

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jul 24 18:52:47 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.67: +11 -10 lines
Diff to previous 1.67 (colored)

change Var_ParseSkip API to increment the position instead of returning a
length, simplifies code.

(warns a bit, symptom of some further issues to fix).

okay millert@

Revision 1.67 / (download) - annotate - [select for diffs], Sun Jul 22 17:56:50 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

make sure loop variables use their own buffers.
(causes .for loops to give weird results very infrequently, memory handling
was slightly wrong, but not enough to break things thoroughly).
noticed by naddy@

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jul 20 12:32:45 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.65: +817 -684 lines
Diff to previous 1.65 (colored)

big clean-up patch:
- rename a few functions in var.c to names that make more sense.
- introduce Var_Deletei because it makes more sense.
- rewrite .for loops to use a local LoopVar construct to avoid looking up more
stuff.
- reformat var.c to near K&R
- rewrite most comments in var.c

shown to a few people. millert@ gave me his okay since it passes through
ports correctly.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jul 20 12:18:47 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.64: +160 -160 lines
Diff to previous 1.64 (colored)

reorder stuff in var.c so that the next patch is more readable.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Jul 8 17:53:15 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored)

rename variable to errorIsOkay. What does oldVars mean anyway ?

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jul 8 17:49:55 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.62: +13 -2 lines
Diff to previous 1.62 (colored)

missed part: add check to avoid poison checking inexistent local vars,
and do for loops for real.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Jul 8 17:44:20 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.61: +278 -296 lines
Diff to previous 1.61 (colored)

A set of big related changes. okay millert@, tested further by kettenis@
and matthieu@

This all revolves around putting ALL global variables into one single big
hash, and using flags. This removes some impossible to understand stuff,
like old varfind, and allows for some nice stuff.
- each time we reference a global variable, we create it, possibly as a dummy
variable.
- each time we go to the environment, we remember it, thus we no longer go
back to it.

Lists of dependant changes:
- isolate changes to oldVars and checkEnvFirst.
- remove VAR_CMD and VAR_GLOBAL contexts. The only distinction is in parsevar.
Split Parse_DoVar into Parse_DoVar and Parse_CmdlineVar
- rework var modules around obtain_global_var, observe flags in various
functions like Var_Value and Var_Seti.
- Var_Seti/Var_Appendi are almost the same code, use that internally.
- add magic to handle the very special SHELL variable.
- introduce Var_Definedi for the cases where we don't want the actual
value, to simplify tests.
- add keyword .poison, parse it and set global flags accordingly.
- do poison_checks where needed.
- document poison.
- in for loops, set variable temporarily, so that Var_SubstVar will also
substitute it in varmodifiers expressions.

Revision 1.61 / (download) - annotate - [select for diffs], Tue Jan 2 13:21:31 2007 UTC (17 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.60: +3 -5 lines
Diff to previous 1.60 (colored)

VarDelete is no longer used by list functions, so let it do type-checking
correctly.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Jan 20 23:10:19 2006 UTC (18 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.59: +17 -17 lines
Diff to previous 1.59 (colored)

use stdint.h where appropriate. okay millert@

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 7 13:11:36 2004 UTC (20 years, 1 month ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.58: +85 -152 lines
Diff to previous 1.58 (colored)

ISO function declarations, trim a few comments, rename a few variables to
more explicit/more consistent names.

okay otto@

Revision 1.58 / (download) - annotate - [select for diffs], Tue Oct 7 18:33:08 2003 UTC (20 years, 7 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored)

- check if result is valid before using it.
- correctly set *freePtr, not freePtr.
input and ok espie@.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:12 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.56: +2 -6 lines
Diff to previous 1.56 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jun 5 18:45:39 2002 UTC (21 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.55: +15 -15 lines
Diff to previous 1.55 (colored)

tweak quick_lookup for a faster path.
okay millert@

Revision 1.55 / (download) - annotate - [select for diffs], Wed May 23 12:34:51 2001 UTC (23 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.54: +85 -275 lines
Diff to previous 1.54 (colored)

Mostly clean-up:
- cut up those huge include files into separate interfaces for all modules.
Put the interface documentation there, and not with the implementation.
- light-weight includes for needed concrete types (lst_t.h, timestamp_t.h).
- cut out some more logically separate parts: cmd_exec, varname, parsevar,
timestamp.
- put all error handling functions together, so that we will be able to
clean them up.
- more systematic naming: functioni  to handle interval, function to handle
string.
- put the init/end code apart to minimize coupling.
- kill weird types like ReturnStatus and Boolean. Use standard bool (with a
fallback for non-iso systems)
- better interface documentation for lots of subsystems.

As a result, make compilation goes somewhat faster (5%, even considering
the largish BSD copyrights to read). The corresponding preprocessed
source goes down from 1,5M to 1M.

A few minor code changes as well: Parse_DoVar is no longer destructive.
Parse_IsVar functionality is folded into Parse_DoVar (as it knows what an
assignment is), a few more interval handling functions. Avoid calling
XXX_End when they do nothing, just #define XXX_End   to nothing.

Parse_DoVar is slightly more general: it will handle compound assignments
as long as they make sense, e.g., VAR +!= cmd
will work.  As a side effect, VAR++=value now triggers an error
(two + in assignment).
- this stuff doesn't occur in portable Makefiles.
- writing VAR++ = value or VAR+ +=value  disambiguates it.
- this is a good thing, it uncovered a bug in bsd.port.mk.

Tested by naddy@. Okayed millert@. I'll handle the fallback if there is
any. This went through a full make build anyways, including isakmpd
(without mickey's custom binutils, as he didn't see fit to share it with me).

Revision 1.54 / (download) - annotate - [select for diffs], Tue May 15 13:31:03 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.53: +9 -4 lines
Diff to previous 1.53 (colored)

Don't go beyond end of string.
Handles unterminated variables, and fixes regression test #10

Revision 1.53 / (download) - annotate - [select for diffs], Thu May 3 13:41:13 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.52: +699 -473 lines
Diff to previous 1.52 (colored)

Synch with my current work.
Numerous changes:
- generate can build several tables
- style cleanup
- statistics code
- use variable names throughout (struct Name)
- recursive variables everywhere
- faster parser (pass buffer along instead of allocating multiple copies)
- correct parser. Handles comments everywhere, and ; correctly
- more string intervals
- simplified dir.c, less recursion.
- extended for loops
- sinclude()
- finished removing extra junk from Lst_*
- handles ${@D} and friends in a simpler way
- cleaned up and modular VarModifiers handling.
- recognizes some gnu Makefile usages and errors out about them.

Additionally, some extra functionality is defined by FEATURES. The set of
functionalities is currently hardcoded to OpenBSD defaults, but this may
include support for some NetBSD extensions, like ODE modifiers.

Backed by miod@ and millert@, who finally got sick of my endless patches...

Revision 1.52 / (download) - annotate - [select for diffs], Fri Mar 2 16:57:26 2001 UTC (23 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.51: +21 -21 lines
Diff to previous 1.51 (colored)

Use the ohash_* that's now in libc.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Dec 7 00:15:43 2000 UTC (23 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.50: +3 -2 lines
Diff to previous 1.50 (colored)

Forgot to copy end of name in nested variable names, so that
${BC_${A}} worked but not ${${A}_BC}.
Noticed by fries@

Revision 1.50 / (download) - annotate - [select for diffs], Fri Nov 24 14:29:56 2000 UTC (23 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.49: +59 -45 lines
Diff to previous 1.49 (colored)

Take advantage of VarModifiers_Apply, which can parse a variable spec
and expand it directly, without needing a variable context.

Use it in Var_SubstVar, so that .for loops values don't need to be entered
into any context nor looked up.

This speeds up .for loops some, and avoids nasty variable capture
side-effects.

Ok'd millert@, miod@, naddy@   (naddy spotted a problem with the first
version of that change).

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 13 08:29:21 2000 UTC (23 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

esetenv: does a setenv and bails out if error.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Sep 14 13:32:08 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.47: +42 -67 lines
Diff to previous 1.47 (colored)

Some systematic clean-up.
- UNUSED macro that expands to __attribute__((unused)) for gcc
- move rcsid around so that they can be tagged UNUSED.
- activate -Wunused.
- use UNUSED instead of kludgy junk for function arguments.
- add extern to all extern prototypes.
- update comments in lst.h.
- clean up var.c a little bit, constifying arguments, updating comments...

Revision 1.47 / (download) - annotate - [select for diffs], Mon Aug 21 10:44:21 2000 UTC (23 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Var_Append needs to set v for DEBUG(VAR) to work.
Obvious fix.
Problem reported by Gregory Steuck, thanks a lot !

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jul 18 20:17:20 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.45: +37 -2 lines
Diff to previous 1.45 (colored)

Handle MAKEFLAGS variation mandated by POSIX.

Code to pass variable definitions to submakes through make flags.
Not activated yet, need to fix src/ first.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jul 17 23:29:35 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.44: +62 -6 lines
Diff to previous 1.44 (colored)

parse embedded variable specs, e.g., ${VAR_${SUB}}

- need braces, as we don't want to change what $$A means,
- this assumes this kind of construct is very infrequent, thus
this does NOT copy the variable name needlessly.
- the expansion code is in a separate function for clarity.

Reviewed by miod@, as previous patches.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jul 17 23:26:50 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.43: +95 -215 lines
Diff to previous 1.43 (colored)

- let VarModifiers_Apply accept NULL string gracefully,
- simplify Var_Parse: use varfind, then leverage on the result
to recognize `special case' dynamic parsing.

VarModifiers_Apply need to be called on NULL strings, to be able to parse
modifiers applied to non-existent variables.

(Alternately, we could call VarModifiers_Apply on a dummy string, but
this is less efficient).

Revision 1.43 / (download) - annotate - [select for diffs], Mon Jul 17 23:09:06 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.42: +3 -1237 lines
Diff to previous 1.42 (colored)

Major unobfuscation: split var modifiers handling to a separate file.
This does finally make var handling somewhat readable.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jul 17 23:06:32 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.41: +365 -394 lines
Diff to previous 1.41 (colored)

separate modifiers handling from Var_Parse into a separate
VarModifiers_apply function.

for env lookup, create variable structure first, so that we can get away
without terminating the variable name in main Var_Parse.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jul 17 23:01:20 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.40: +7 -41 lines
Diff to previous 1.40 (colored)

This does replace Str_Match with a better routine, which handles negated
intervals, and \\ in intervals.

Accordingly, var.c no longer needs to copy the :Marg to replace \: with :

We don't use fnmatch(3) because of various optimizations which are harder
to achieve in a generic setting.

Also add regression suite for the Str_Match function.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jul 17 22:57:37 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.39: +48 -54 lines
Diff to previous 1.39 (colored)

Constify a few functions, propagated from VarModify.
Replace a few int -> size_t

Reviewed by miod@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jul 17 22:55:12 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.38: +46 -44 lines
Diff to previous 1.38 (colored)

- recognize that FIND_CMD and FIND_GLOBAL are always used together,
- introduce VarFind_interval function. This avoids having to copy variable
names in VarParse,
- expose internals of VarFind* function (not used yet, but this will avoid
multiple lookups in VarParse),
- constify a few functions.

Reviewed by miod@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 23 16:27:29 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.37: +159 -122 lines
Diff to previous 1.37 (colored)

This is the speed-up patch, which doubles make speed (almost).

Use the open hashing functions for global contexts instead of List in
var.c.

All the preliminary work to trim down local contexts means that we don't
suffer from the heavy initialization work that a hash table entails.

There is some make kludgery to:
- build the hashing functions as a library,
- recreate hashconsts.h, even if make depend was not invoked.

One point of the hashing scheme written was to separate the computation
of the hash function, and the hash lookup itself. This is very convenient
for make, because of those pesky special variables. hashconsts.h is there
to pre-hash the correct values, which replaces a few expensive string
comparisons with quick hash value comparisons, followed by one expensive
string comparison. The modulus MAGICSLOTS chosen in the Makefile is
ad-hoc: it is small enough to write a small switch without collision,
and will need changing if the hash function changes...

The function quick_lookup is the most important:
it either returns an index, for a local variable, or it does compute a
hashing value, and returns -1.

Another somewhat controversial decision is the use of string intervals.
This avoids either copying a string, or twiddling with a byte for cases
such as ${VAR}.

Finally, the variable name is stored within the variable itself. Since
a given variable name never changes, this makes sense. All that was needed
was a hash library with support for this.  Note that the hashing table
holds only a variable pointer AND the corresponding hashing value, WITHOUT
a modulo hashtablesize. Two reasons:
- hash resizes can be done faster, without having to recompute hashing values.
- locality of access. The hash table fits into memory without problem. Once
a candidate slot is found, we check the complete hashing value. Probability
of a collision is very small (32 bits...). So bringing up the whole
variable in memory at once is good: the name will almost always match, in
which case we want the variable value as well, so it makes sense to put
them together.

The ohash functions implement open hashing, as described in Knuth, but with
a variable table size.  Choosing powers of 2 sizes does not yield more
collisions, but it makes the hashing scheme much simpler. The thresholds at
which to expand/shrink the tables seem to work well in practice. The
default sizes were chosen such that the tables hardly ever shrink or expand
anyways (though I've tried with smaller/larger sizes to verify that the
shrinking/expanding worked correctly): larger Makefiles hold roughly
500/600 variables, which fits without trouble into a 1024-sized variable.

Disregard #ifdef STATS_HASH, this is some internal scaffolding I'm using
to measure make performance.

The only known issue with open-hashing is that deletions cannot create
empty slots, but do leave slots marked as `occupied once' so that lookup
works.  We use a well-known optimization which records those pseudo-empty
slots while looking up values. If the value is not found, the pseudo-empty
slot is returned to be filled. If the value is found, it is swapped with
the pseudo-empty slot. This is an improvement in both cases, since this
shortens the length of lookup chains, eventually pushing the pseudo-empty
slots to the end.

Reviewed by millert@ and miod@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jun 23 16:23:26 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.36: +239 -147 lines
Diff to previous 1.36 (colored)

This patch separates local contexts from global contexts for good.
Apart from a few casts, VAR_GLOBAL and friends are separate
data structures, so we use a small array for local variables.

We also junk allVars, since TargFreeGN can release local nodes,
and var.c has explicit lists for its variables already.

Reviewed millert@ and miod@.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 23 16:21:44 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.35: +14 -10 lines
Diff to previous 1.35 (colored)

In various places, VAR_CMD is used to actually mean `no real context',
since lookup will start with VAR_CMD in any case.
This fixes VarFind and Var_Parse to handle ctxt == NULL correctly, and
replace those confusing VAR_CMD with proper NULL pointers.

This patch also handles three small details:
- .CURDIR is necessarily set in VAR_GLOBAL,
- suffix handling for archives copies two hard-coded variables, for
which it can use a quick path,
- typos in TargFreeGN.

Reviewed millert@, miod@.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jun 23 16:20:01 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.34: +75 -49 lines
Diff to previous 1.34 (colored)

Once those special variable are taken care of, other Var functions can take
the GNode's context directly.  We rename that special Lst to `SymTable *'
in prevision of things to come.

Along the line, we lose the special GNodes affected to VAR_CMD, VAR_GLOBAL,
VAR_ENV, which become simple Lsts... This is not a problem, except when
getting to a context's name for debugging (handled very nicely by
offsetof).

Again, this is a preparatory patch, which does not gain anything except
for cleaning up issues...

Reviewed by millert@ and miod@, like the previous patch

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jun 23 16:18:09 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.33: +48 -2 lines
Diff to previous 1.33 (colored)

Start of variable fixes and speed-ups.

This patch may seem a bit non-sensical at first. It simply introduces some
new interface. Specifically, recognizes that some variable names
(.TARGET/$@, .OODATE/$?, .ALLSRC/$>, .IMPSRC/$<, .PREFIX/$*, .ARCHIVE/$!,
.MEMBER/$%) are `special' (the actual variables which are local to a
target, e.g. GNode).

Currently, The Varq functions (for Varquick access) are only stubs to the
normal functions.

This fixes a very important detail before proceeding to turn variable lists
into hash tables: if every GNode holds a hash table, initialization times
for those will be very costly. But generic GNodes only hold those seven
special variables... which can be stored directly into a small array;
the only general cases are the environment, the command line and
global variables.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jun 17 14:38:20 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.32: +19 -22 lines
Diff to previous 1.32 (colored)

This patch introduces a distinction between
Lst_Init (constructor) and Lst_New (allocation + construction)
Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction),
and uses that to turn most dynamic allocation of lists (Lst pointers)
into static structures (LIST).

Most of this is mundane, except for allGNs in targ.c, where the code must
be checked to verify that Targ_Init is called soon enough.

Lst_New is a temporary addition. All lists will soon be static.

Reviewed by millert@, like the previous patch.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 10 01:41:06 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.31: +44 -46 lines
Diff to previous 1.31 (colored)

Clean-up patch: use `void *' instead of old-fashioned ClientData/Address.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jun 10 01:32:23 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.30: +8 -9 lines
Diff to previous 1.30 (colored)

Thus, Lst_ForEach no longer needs returning a status.
In fact, it can become a macro based on Lst_ForEachFrom.
This also introduces Lst_Every, as a shortcut for the very common case where
Lst_ForEach does not need any user data.

Finally,  make consistent use of a few function typedefs, instead of having
explicit void (*)(Lst)  arguments all over the place.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 26 16:21:33 2000 UTC (24 years, 1 month ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.29: +27 -31 lines
Diff to previous 1.29 (colored)

Remove idiotic, braindead casts T* -> void*
They serve no purpose, except hiding potential bugs.

In particular, remove (ClientData) cast from macro, showing potentially
troublesome use of Hashes to store time_t.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jan 8 09:45:16 2000 UTC (24 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.28: +5 -5 lines
Diff to previous 1.28 (colored)

Finish changing all Var_Parse arguments to size_t. Thanks to millert@
for reminding me.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Dec 19 00:04:25 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.27: +8 -8 lines
Diff to previous 1.27 (colored)

Rearrange Lst_Find interface to conform better with other functions.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Dec 18 21:58:08 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

Nothing ever checks ReturnStatus on Lst_Insert, Lst_Append, Lst_AtFront,
Lst_AtEnd, Lst_Concat, Lst_Remove, Lst_Replace.

Don't bother returning one.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Dec 18 21:53:33 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.25: +20 -20 lines
Diff to previous 1.25 (colored)

NIL, NILGNODE, etc, are only glorified NULL.
Get rid of them.

Get rid of list.h, nothing uses it anyway.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Dec 18 02:11:27 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

make does not use circular lists, get rid of the extra weight.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Dec 16 17:27:18 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.23: +140 -130 lines
Diff to previous 1.23 (colored)

Var_Subst is actually two distinct functions folded into one:
split the function specific to for.c out, and give them more sensible
arguments at the same time.

This makes .for loop handling more efficient, as we have some heuristic
to evaluate the size of the buffer needed...

Revision 1.23 / (download) - annotate - [select for diffs], Thu Dec 16 17:02:45 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.22: +53 -60 lines
Diff to previous 1.22 (colored)

Allocate buffers as static data structures.
This cuts down quite a lot of malloc, since in actual use,
buffer usage is mostly static.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Dec 16 16:52:11 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.21: +2 -8 lines
Diff to previous 1.21 (colored)

Remove unneeded extraneous zeros at the end of buffers.

Actually, one of these needs to be there, because of two bugs in cond.c

Revision 1.21 / (download) - annotate - [select for diffs], Thu Dec 16 16:41:42 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.20: +15 -15 lines
Diff to previous 1.20 (colored)

Split Buf_GetAll into Buf_Retrieve/Buf_Size.
(idiotic to retrieve size every time when it's used half the time)

Revision 1.20 / (download) - annotate - [select for diffs], Thu Dec 16 16:27:13 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Start cleaning up buf.c in earnest.

- Buf_Discard is only used to remove all the bytes in a buffer,
replace with Buf_Reset,
- buffer values are not read unless accessed first through Buf_GetAll,
no need to null-terminate it at every point.
- Buf_Expand need not check if the expansion is needed. That's Buf_AddChar
and Buf_AddChars responsability (otherwise, Buf_AddChar checks twice)
- Buf_Overflow only handles overflow. Adding the character is done in
every case anyway.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Dec 9 18:18:24 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.18: +68 -99 lines
Diff to previous 1.18 (colored)

Introduce `common usage' buf patterns and use them.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Dec 6 22:28:44 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.17: +3 -5 lines
Diff to previous 1.17 (colored)

Extra parameter no longer needed, ditch.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Dec 6 22:27:37 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.16: +71 -91 lines
Diff to previous 1.16 (colored)

Instead of retrieving var values from the environment again and again,
it is much better to keep them in the global context, marked read-only.

This also makes the next simplification possible, since var values need no
longer be free'd by client code.

(reviewed by ho@, like other patches)

Revision 1.16 / (download) - annotate - [select for diffs], Mon Dec 6 22:24:32 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.15: +94 -95 lines
Diff to previous 1.15 (colored)

Clean up buffers interface somewhat:

- buf.c deals exclusively with chars. Be explicit about it, and remove
extraneous dumb casts to char (can hide real type errors).
- buffer sizes are size_t. Note that bp->left can never become NULL.
- Buf_GetAll is happy with a NULL pointer for the size, remove unneeded
extra pointers.
- Propagate size_t to all places where buffer functions are used.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 11 11:35:17 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Kill Str_FindSubString, it's strstr.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 10 14:11:49 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.13: +4 -2 lines
Diff to previous 1.13 (colored)

Turn on strict-prototypes, add missing prototypes.
Move main prototype to main.c, as this is not used
from any other file.

Close open bug.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Nov 6 14:34:42 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Bug-fix: when expanding a specific variable v in $A,
check that v is PRECISELY A.

Other BSDs, take notice.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 28 21:57:04 1999 UTC (24 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Fix
.if defined(VAR) && ${VAR:m}

cond.c has special code (set err to 0) to tell VarParse it shouldn't care
if the variable is not defined.

But this was not completely added, namely the path that deals with
modifiers was blissfully unaware of that.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Sep 25 14:44:00 1999 UTC (24 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.10: +86 -2 lines
Diff to previous 1.10 (colored)

Add :L/:U modificators (lowercase/uppercase)
To use to get ports building more user-friendly.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Dec 5 00:06:29 1998 UTC (25 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.9: +7 -4 lines
Diff to previous 1.9 (colored)

Modifications from netbsd:
- don't interfere with MACHINE/MACHINE_ARCH defines for bootstrap
- type clean-up, time_t, and printing `unknown' ints
- fix TARGET/MEMBER bug in archive rules
- memmove...
- cleaner Error handler.
- reentrant brk_string
- .MAKE env variable
- preliminary scaffolding for .NOPATH

Other improvements:
- efree
- shellneed streamlined
- display Stop in .CURDIR after an error.
- document most features and misfeatures.
- add a few OpenBSD notes to the tutorial.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 23 18:49:05 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

portable bootstrap thing; lidl@eng.us.uu.net

Revision 1.8 / (download) - annotate - [select for diffs], Mon Mar 30 06:59:39 1998 UTC (26 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.7: +2 -3 lines
Diff to previous 1.7 (colored)

Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various places

Revision 1.7 / (download) - annotate - [select for diffs], Thu Dec 18 21:50:45 1997 UTC (26 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +13 -12 lines
Diff to previous 1.6 (colored)

for the test following test case, do not output FOOBAR=bar (should be FOOBAR=)
problem reported by mark@thuvia.demon.co.uk

FOO=
FOOBAR=$(FOO:=bar)

Revision 1.6 / (download) - annotate - [select for diffs], Tue Apr 1 07:28:28 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.5: +422 -146 lines
Diff to previous 1.5 (colored)

Sync with NetBSD (mostly by christos initial substitution/regexp from Der Mouse)

- fix the variable substitution code in make [PR/2748]
      1. change s/a/b/ so that it substitutes the first occurance of the
         pattern on each word, not only the first word.
      2. add flag '1' to the variable substitution so that the substitutions
         get performed only once.

  ***THIS IS AN INCOMPATIBLE CHANGE!***

  Unfortunately there was no way to make things consistent without
  modifying the current behavior. Fortunately none of our Makefiles
  depended on this.

            OLD:

                VAR      = aa1 aa2 aa3 aa4

                S/a/b/   = ba1 aa2 aa3 aa4
                S/a/b/g  = bb1 bb2 bb3 bb4

            NEW:
                VAR      = aa1 aa2 aa3 aa4

                S/a/b/   = ba1 ba2 ba3 ba4
                S/a/b/1  = ba1 aa2 aa3 aa4
                S/a/b/g  = bb1 bb2 bb3 bb4
                S/a/b/1g = bb1 aa2 aa3 aa4
- add regexp variable substitution via 'C/foo/bar/' [PR/2752]
- add variable quoting via the ${VAR:Q} modifier. This is useful when running
  recursive invocations of make(1):

        make VAR=${VAR:Q}

  will always work... (This may prove useful in the kernel builds...) [PR/2981]
- BSD did not traditionally have <sys/cdefs.h>; use BSD4_4 instead and include
  <sys/param.h> to grab it.
- Don't compile the regex code if MAKE_BOOTSTRAP (from gwr)
- Use explicit .c.o rule in Makefile.boot so that the bootstrap process works.
- Use only integral types in procedure arguments. [buf.c buf.h]
- Include <stdlib.h> to get getenv() prototype on SVR4
- if __STDC__ -> ifdef __STDC__ to appease SVR4
- Define const and volatile for non __STDC__
- Implement snprintf() and vsnprintf() for non BSD4_4 systems.
- Make $MACHINE_ARCH settable from the environment.
- Fix .USE directive problems: (reported by cgd)
    1. ${.*} variables did not get expanded in dependencies.
    2. expanded ${.*} variables in .USE dependencies can cause tree
       restructuring; handle it.
    3. in compat mode, expand .USE before evaluating the list of targets,
       instead of doing .USE expansions on demand, because they can cause
       tree restructuring.
- Add a .MADE directive to indicated that the children of a target are
  up-to-date, even when they are not. This is to simulate our current
  make install behavior with proper dependencies.
- Fix problems in the RE substitution error handling.
- Locate all the children of a node marked as MADE.
- Do not compile-in ${MACHINE} (as per NetBSD PR#3386)
- Disable globbing for targets/dependencies when POSIX is defined.
- Fix globbing so that patterns that don't have a matching number of [] or {}
  don't get expanded. (before the [ case got expanded to nothing!) This is
  disabled.
- Make sure that the children of nodes that are marked .MADE, are marked
  UPTODATE and their timestamps are consistent.
- Don't disable wildcards completely; they are used by other Makefiles.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Nov 30 21:09:07 1996 UTC (27 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.4: +54 -64 lines
Diff to previous 1.4 (colored)

Sync with NetBSD:
- Merge in FreeBSD and Lite2 changes.
- Fix bug where a non-archive target with a .a suffix would always
  be considered to be out of date, since it does not have a TOC.
- Fix NetBSD PR #2930: declare missing variable.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 2 16:04:22 1996 UTC (27 years, 8 months ago) by briggs
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.3: +28 -9 lines
Diff to previous 1.3 (colored)

Sync up with NetBSD:
(christos)
	Fix bug reported by Greg Hudson where leaf (source only) nodes were
	referenced only by their basename and not by their full pathname. This
	breaks when .PATH or MAKEOBJDIR are used. There might be Makefiles
	around that try to work around this bug by prepending ${.CURDIR} to
	the sources, and they should be found and fixed. Also a lot of the gunk
	in suff.c that was attempting to work around the same problem could be
	removed.
(christos)
	- Move -D flags from Makefile to config.h and explain what they do. Add
	  -Wall -Wno-unused to CFLAGS. Add new define SYSVVARSUB to enable SysV
	  style variable substitutions and enable them.
	- Add SunOS style command substitutions via SUNSHCMD
	- Fix core dump with '{variable = value'
(christos)
	Fix bug where make will always exit with 0, even when one or more
	parallel jobs failed. (Only affects parallel make code)
(christos)
	Protect __P from being multiply defined (for systems that already
	define it)
(christos) Add strdup() since ultrix is missing it.
	From Larry Schwimmer <rosebud@cyclone.Stanford.EDU>
(christos) Add estrdup(), a checked version of strdup and use it.
(christos) Recognize SVR4 style long filename entries in archives.
(thorpej) Tidy up some RCS ids a bit.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 26 05:36:39 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

rcsid

Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 14 03:23:41 1995 UTC (28 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

from christos@netbsd:
Minor:
    - ${.PREFIX} should never contain a full pathname
    - Fixed gcc -Wall warnings
Major:
    - compatMake is now FALSE. This means that we are now running in
      full pmake mode:
          * rules on dependency lines can be executed in parallel and or
            out of sequence:

            foo: bar baz

            can fire the rule for baz before the rule for bar is fired.
            To enforce bar to be fired before baz, another rule needs to be
            added. [bar: baz]
          * adjacent shell commands in a target are now executed by a single
            invocation of the shell, not one invocation of the shell per line
      (compatMake can be turned off using the -B flag)
    - The -j flag now works... I.e. make -j 4 will fork up to four jobs in
      parallel when it can. The target name is printed before each burst
      of output caused by the target execution as '--- target ---', when j > 1
    - I have changed all the Makefiles so that they work with make -j N, and
      I have tested the whole netbsd by:
          'make -j 4 cleandir; make -j 4 depend; make -j 4; make -j 4 install'
    - I have not compiled or tested this version of make with -DREMOTE.
- Turn compat mode on by default. It gets turned off when the -j without
  the -B flag is specified. [Thus you can use -j 1 to turn it off].
- Fix malloc -> emalloc as Gordon noted.
Updates for POSIX/SVR4 compiling:
arch.c:          Don't require ranlib stuff. Not everybody has it.
dir.c:           SunOS-4 != Solaris; change #ifdef sun to #if sun && !__svr4__
job.c, compat.c: Don't use 'union wait', use int and the W*() macros.
main.c:          Check for uname() == -1; some unames return > 0...
util.c, job.c:   Add signal() with BSD semantics for svr4, don't use bsd
                 sigmask and friends.

from cgd@netbsd:
pull in make.h.  (PAlloc() now uses emalloc(), which is prototyped in
make.h.  If the prototype is not in scope on the Alpha, I see lots
of "cast to pointer from integer of different size" warnings.)

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:43 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:43 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.