summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/arch.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* switch to <limits.h>; ok millertderaadt2015-01-161-2/+1
|
* If some mythical system lacks PATH_MAX, do not set it to MAXPATHLEN+1deraadt2015-01-151-9/+1
| | | | ok millert
* adjust to ohash being in libutil now, and to the interface changes.espie2014-05-121-3/+3
| | | | | | 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.
* wrappers for is*/to* that make damn sure their arguments areespie2013-11-221-6/+6
| | | | | | cast to unsigned chars. okay deraadt@
* remove TIMESTAMP abstraction layer, prodded by theo.espie2013-04-231-12/+12
| | | | | | | | | | | 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.
* more changes, discussed and tested by various people.espie2012-10-021-136/+1
| | | | | | | | | | | | | | | | | - 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.
* Correct $OpenBSD$ stuffespie2010-07-191-2/+1
|
* two small changes:espie2010-07-191-1/+1
| | | | | | | | | | | - allow variables in SysV modifiers, as requested by matthieu@ (since recursive variables are an extension, this just extends the extension) - variation on :Q called :QL (quote list), which does quote every character EXCEPT for whitespace. e.g., toto: @for i in ${VAR:QL} ...
* Add a new default variable in Makefile context, MACHINE_CPU. Its value ismiod2010-02-031-1/+5
| | | | | | | | | decided at compile-time and is either MACHINE_CPU from <machine/param.h> if it is defined, or the same value as MACHINE_ARCH otherwise. This will be used to allow ports with suffixes to their canonical MACHINE_ARCH to provide this canonical name as MACHINE_CPU, and in turn to let Makefiles do TRT. ok kettenis@
* modify timestamp handling to grab current time instead of relying on aespie2009-08-161-2/+2
| | | | | | | stale timestamp. all those diffs sent to people ages ago, who didn't answer, except for Theo, who said he ran it with no issues, so let's get this in...
* simplify dynamic variable handling a great deal:espie2007-11-171-5/+5
| | | | | | | | | | | 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.
* rename make -> must_make, made -> built_statusespie2007-11-101-3/+3
| | | | to make them easier to find in source files.
* #ifdef stuff that is only used under #ifdef; ok espiederaadt2007-11-031-1/+3
|
* Work done at p2k7.espie2007-11-021-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a really big step towards getting parallel make to work. Note that this is not yet complete. There are still a few `details' to fix before this works 100%. Specifically: sequential make (compat) and parallel make don't use the same engine, and the parallel engine still has a few limitations. For instance, some known issues: - parallel make does not deal with .phony targets correctly all the time. - some errors are deadly in parallel make mode. - parallel make NEEDS way more sturdy correspondance of file system paths and target names, since it often needs to match dependencies to targets before the corresponding files exist. - some local variables like $* get set in a bogus way in some cases. - suffix handling has issues, especially related to the NULL suffix. So, if you find stuff that does NOT yet work with parallel make, don't go blindly try to fix the Makefile. It's very likely you might have stumbled into a make bug. (unless you really, really, understand Makefiles, DON'T GO CHANGING THEM YET). Tested by lots of people, thanks go to miod@, and robert@ among other people. Quick summary of what this does: - remove `saving commands' extension (it's not really usable, nor used) - move compat job runner and parallel interrupt handling into engine.c - tweak the code so that both compat and parallel mode use the same job runner and the same interrupt handling. Remove the other one. - optimize job runner so that, in parallel mode, the last command does not fork if we can avoid it (as it's already running in a sub shell). - scrape all the code that dealt with creating shell scripts from commands. - scrape all the code that dealt with recognizing special sequences in command output to print/not print output. - fix the parallel job pipe to not keep around file descriptors that are not needed. - replace the parallel job buffering with a nicer one, that deals with non-blocking descriptors to try to agregate as much output from one job in one go (greed) to unconfuse the users. - create two pipes per job, so that stdout and stderr stay separate. - make job token printing a debug option. - always use the parallel job-runner to `execute' commands, even if we just print them out. - store list of errors encountered during parallel make running, and print them on exit, so that we know what went wrong. - add a dirty hack to targ.c to deal with paths produced by gccmakedep.
* always define the svr4namelist. Doesn't hurt, even if we don't use it.espie2007-09-171-15/+1
|
* fix the arch code mostly.espie2007-09-171-135/+128
| | | | | | | | | | - stop using sprintf for code that can use our buffers. - stop modifying parsed line, rely on Var_Substi instead. to do that, we need to go through an intermediate routine that uses one single buffer to build archive names. also introduce an add_archive_node function that makes things way simpler. also rename a few variables.
* kill extra spaces at end of lineespie2007-09-171-29/+29
|
* rename dirSearchPath -> defaultPath, and openDirectories -> knownDirectoriesespie2007-09-161-2/+2
|
* minor reindent issuesespie2007-09-161-35/+35
|
* rename Targ_FmtTime into time_to_string and move it, as it's not relatedespie2007-09-161-2/+2
| | | | to target nodes at all (reduces modules inter-dependencies)
* reuse free_hashespie2007-09-161-15/+2
|
* reindent arch.cespie2007-09-161-595/+621
|
* cut up dir.c into dir.c/direxpand.c as there is very little interface betweenespie2007-09-161-1/+2
| | | | two modules that do different things.
* more dead code: we always define LIBRARIES and INCLUDESespie2007-09-161-5/+1
|
* remove dead code: #define RECHECK is always onespie2007-09-161-1/+1
|
* everywhere except in Var_Parse, we always add/append variables to theespie2007-07-301-1/+1
| | | | | | | | 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@
* simplify computations in the var module: instead of advancing a char *espie2007-07-241-1/+1
| | | | | | | | | | 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@
* move the code that grabs a value in Var_Parse in its own function,espie2007-07-241-1/+1
| | | | | | | | | 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@
* change Var_ParseSkip API to increment the position instead of returning aespie2007-07-241-8/+3
| | | | | | | | length, simplifies code. (warns a bit, symptom of some further issues to fix). okay millert@
* remove some bogus *p tests from charles longeautedu2007-03-201-3/+3
| | | | ok deraadt millert
* use stdint.h where appropriate. okay millert@espie2006-01-201-2/+2
|
* ISO function declarations, trim a few comments, rename a few variables toespie2004-04-071-131/+116
| | | | | | more explicit/more consistent names. okay otto@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* get rid of some strcpy/sprintf.espie2003-04-061-5/+8
| | | | ok krw@, matthieu@, deraadt@
* use defined(__ELF__) instead of a list of ELF architectures from whichmatthieu2002-01-301-3/+2
| | | | | sparc64 was missing. This fixes a bug with ELF static libraries on sparc64
* occured->occurredmpech2001-09-191-2/+2
| | | | | | | idea from deraadt@ via NetBSD millert@ ok p.s. Next commit will fix a typo in the sys/
* Better warning fix, in line with the rest of the codeespie2001-06-071-4/+3
| | | | | (__attribute((__unused__)) denotes parameters that MAY be unused in the code, e.g., it's mostly a `shut up warnings' device).
* Use Str_concat instead of fixed buffers and snprintf in building paths.espie2001-06-051-5/+13
| | | | | Replace MAXPATHLEN with PATH_MAX (synch with op-make). ok naddy@
* -Wall cleanup, mostly useless otherwisederaadt2001-05-301-2/+7
|
* Take includes out of lst.h, re-add what's needed to separate files.espie2001-05-291-1/+2
| | | | Removes remaining lint stuff from lst.lib.
* Mostly clean-up:espie2001-05-231-223/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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).
* Synch with my current work.espie2001-05-031-313/+238
| | | | | | | | | | | | | | | | | | | | | | | | | 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...
* Use the ohash_* that's now in libc.espie2001-03-021-25/+25
|
* This patch fixes ArchFindMember so that it handles SVR4 membersespie2000-11-271-113/+115
| | | | | | | | | | similarly to read_archive. Note we no longer bother seeking back to the start of the header, as only ArchTouch accesses that header, and can do the seek itself. With this, arch handling should be working, more or less. thanks to Todd, Miod, Naddy for reviewing those patches.
* This does fix some nasty issues: ar field members are NOT null-terminated.espie2000-11-271-54/+68
| | | | | | Hence, read_archive must be very careful to parse stuff correctly: don't use str* when mem* are appropriate, copy numeric fields and ensure they're terminated...
* We take of the SVR4 archive handling data structure from our archive,espie2000-11-271-82/+86
| | | | | | | | | | | and put it into a specific structure (it is wasteful to keep lugging SVR4 structures once an archive is parsed). By tweaking read_archive slightly, we can achieve a nicer interface to ArchSVR4Entry. Note a bug in make: ArchFindMember does (currently) not use the SVR4 code, hence some archive members won't be found in non-caching mode...
* Factorise duplicated code involved in touching archives.espie2000-11-271-32/+26
|
* As it stands now, arch.c does not work.espie2000-11-241-159/+158
| | | | | | | | | | | Its main failing is that ar headers are NOT null terminated. This code is atrocious. This change starts cleaning that up. Replace the list of cached archives with a hash, streamline the logic of ArchMTimeMember, by taking out the actual function that does the reading (read_archive). More fixes to come.
* Change the time stamp interface to use an abstract datatype.espie2000-11-241-61/+44
| | | | | | | | Define two possible interfaces: the classic one, and the new one (used where available) that depends on timespec. Better granularity, make is now able to distinguish between files that were built during the same second.
* Fix Arch_MemMTime (previous change I did was bogus)espie2000-10-131-11/+5
|