summaryrefslogtreecommitdiff
path: root/misc.c
Commit message (Collapse)AuthorAgeFilesLines
* Update Copyright statements for 2014.Paul Smith2014-09-301-1/+1
|
* [SV 40361] Don't use vsnprintf(), which is an ISO C99 function.Paul Smith2013-11-231-5/+5
| | | | | | | | | | * output.c (error, fatal, message): Take an extra argument specifying how many bytes are used by the formatted arguments. (get_buffer): New function that allocates the requested buffer size. Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded. * makeint.h: Declare various helper macros for generating output. * *.c: Change all error(), fatal(), message() calls to use the macros, or pass the extra length argument directly.
* Add VMS port updates from Hartmut Becker.Paul Smith2013-09-221-0/+1
|
* [SV 33134] Don't try to close stdout when it's already closed.Paul Smith2013-09-141-47/+0
|
* Support the -Orecurse option properly.Paul Smith2013-09-141-95/+1
| | | | | | | | In this mode we still collect all the output from a given target and dump it at once. However we don't treat recursive lines any differently from non-recursive lines. Also we don't print enter/leave messages after every dump. However we do ensure that we always print them once to stdout, so the parent make will collect it properly.
* Enhance the output sync mode.Paul Smith2013-09-121-176/+1
| | | | | | | | | | | | | | | Create a new file, output.c, and collect functions that generate output there. We introduce a new global context specifying where output should go (to stdout or to a sync file), and the lowest level output generator chooses where to write output based on that context. This allows us to set the context globally, and all operations that write output (including functions like $(info ...) etc.) will use it. Removed the "--trace=dir" capability. It was too confusing. If you have directory tracking enabled then output sync will print the enter/leave message for each synchronized block. If you don't want that, disable directory tracking.
* [Bug #39158] Source cleanups suggested by cppcheck utility.Paul Smith2013-07-211-5/+3
|
* Set O_APPEND mode for stdout/stderr and output-sync temporary files.Paul Smith2013-06-281-0/+20
| | | | | | | | POSIX does not guarantee that writes will be atomic if a file is opened for normal (non-append) output. That means if multiple processes are writing to the same file, output could be lost. I can't think of a real use-case where we would NOT want append for stdout/stderr, so force it if we can.
* Create a character map to use for locating stop-points in strings.Paul Smith2013-06-221-31/+1
| | | | | | | | | In various places we were passing flags and characters to compare, then using complex conditionals to see where to stop in string searches. Performance numbers reveal that we were spending as much as 23% of our processing time in these functions, most of it in the comparison lines. Instead create a character map and use a single bitwise comparison to determine if this is any one of the stop characters.
* Update source file format: remove TABs, use GNU coding styles.Paul Smith2013-05-171-83/+83
|
* Update copyright for changes in 2013.Paul Smith2013-05-171-1/+1
|
* Add new --trace[=MODE] flags, with --trace=dirPaul Smith2013-05-131-6/+2
| | | | | | This mode replaces the previous heuristic setting enabled with -O, where we would log directory enter/leave for each synchronized output. Now we only do that if --trace=dir is given.
* Ensure command lines are written synchronously with -O.Paul Smith2013-05-051-20/+4
| | | | | | | If output-sync is enabled, have make write the command line to the temp file instead of printing it directly to the screen to ensure that the output is ordered properly. Also, remove extraneous enter/leave operations by having them printed directly when dumping temp file output.
* Improve sync handling for -Ojob/-Otarget and recursion.Paul Smith2013-05-041-6/+13
| | | | | | | | | | If we are not going to sync a command line then dump any collected output first to preserve ordering. Do some code cleanup: * Move the handle init to a separate function. * Move the temp file truncation to the output function. * Remember whether we sync in a variable for readability. * Handle EINTR and short writes in child_out(). * Always call sync_output() in case output_sync was changed due to error.
* Ensure error messages are printed with sync'd output.Paul Smith2013-04-281-0/+73
| | | | | | Enhance the child_error() function so that it will write error output to the child's sync output buffer, if it exists. If it doesn't the output goes to stdout/stderr.
* Remove support for pre-ANSI variadic function calls.Paul Smith2013-04-281-77/+14
| | | | | | | We've required support for ANSI C (ISO C 89) or better for quite a while. Get rid of the old varags.h, doprnt() stuff and simply assume ANSI C variadic function capability and basic C runtime library support (vfprintf, vsprintf, etc.)
* Create an open_tmpfd() function to return temp files by FD. Use it.Paul Smith2013-04-161-0/+79
|
* Rename the "parallel-sync" option to "output-sync".Paul Smith2013-04-141-6/+6
|
* Initial patch for output synchronization. See Savannah bug #33138.Frank Heckenbach2013-04-141-3/+21
| | | | Based on work by David Boyce <David.S.Boyce@gmail.com>.
* Rename struct floc to typedef gmk_floc as an externally scoped symbol.Paul Smith2013-01-201-4/+4
|
* Rename the make.h file to makeint.h for internal use only.Paul Smith2013-01-201-1/+1
|
* Simplify copyrights using ranges of years.Paul Smith2012-03-051-3/+1
| | | | | The new GNU Maintainer's Manual allows the use of year ranges in certain situations; take advantage of this simplification.
* Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.Paul Smith2012-03-041-2/+2
| | | | Fixes Savannah bug #34530.
* Modify backslash/newline handling for POSIX.Paul Smith2012-03-031-3/+8
| | | | | | | | | | We fixed Savannah 16670 but that broke previously-working makefiles that relied on the GNU make behavior. The POSIX behavior doesn't seem to me to be better, and can be obtained using GNU make as well, so put it back as the default behavior and require .POSIX to get the POSIX behavior. Add a new section to the manual discussing backslash/newline handling. Update the test suite.
* Update copyright notices.Paul Smith2012-01-161-3/+3
|
* Changes to resolve warnings.Paul Smith2011-11-141-1/+1
| | | | Fixes Savannah bug #34608.
* Improve backslash/newline handling to adhere to POSIX requirements.Paul Smith2010-11-061-3/+0
|
* - Many fixup patches from Savannah.Paul Smith2010-07-191-0/+28
| | | | | - Fix the test suite on Solaris (from Boris) - Update the manual for .ONESHELL
* Fix buffer overrun in concat().Boris Kolpackov2010-07-161-0/+8
|
* Update copyrights for 2010.Paul Smith2010-07-131-2/+2
|
* Update copyright years.Paul Smith2009-10-251-2/+2
|
* - Rework secondary expansion so we only defer it if there's a possibilityPaul Smith2009-09-241-3/+6
| | | | | | it might be needed: for most situations we parse prereqs immediately as we used to. Reduces memory usage. - Fixes Savannah bug #18622.
* - Add xcalloc() and call itPaul Smith2009-09-161-37/+48
| | | | | | | | | - Fix memory errors found by valgrind - Remove multi_glob() and empower parse_file_seq() to do its job: the goal here is to remove the confusing reverse/re-reverse we do on the file lists: needed for future fixes. - Add a prefix arg to parse_file_seq() - Make concat() variadic so it can take arbitrary #'s of strings
* - Modify access of config and gnulib Savannah modules to use GITPaul Smith2009-06-041-2/+4
| | | | | | | | | | | | | - Fix Savannah bug #24655. - Fix Savannah bug #24588. - Fix Savannah bug #24277. - Fix Savannah bug #25697. - Fix Savannah bug #25694. - Fix Savannah bug #25460. - Fix Savannah bug #26207. - Fix Savannah bug #25712. - Fix Savannah bug #26593. - Fix various doc issues.
* Found this change in an old CVS workspace: rewrite savestring() to thePaul Smith2009-05-241-6/+14
| | | | more standard xstrndup().
* * Update to GPLv3Paul Smith2007-07-041-4/+4
| | | | | * Update copyright to 2007 * Fix download URL for translation files (thanks to Thiemo Seufer)
* Fix Savannah bug #19656: rationalize our use of case-insensitive stringPaul Smith2007-05-091-0/+27
| | | | | | | comparison functions to always use POSIX strcasecmp(). For non-POSIX systems that use other functions (strcmpi or stricmp) use a macro to alias strcasecmp to those. If we can't find any of them (VMS, plus whatever UNIX doesn't have them) then define our own version in misc.c.
* This is a major update, which switches virtually every allocated-but-not-freedPaul Smith2007-03-201-63/+38
| | | | | | | | | | | | | | | string into the strcache. As a side-effect, many more structure members and function arguments can/should be declared const. As mentioned in the changelog, unfortunately measurement shows that this change does not yet reduce memory. The problem is with secondary expansion: because of this we store all the prerequisites in the string cache twice. First we store the prerequisite string after initial expansion but before secondary expansion, then we store each individual file after secondary expansion and expand_deps(). I plan to change expand_deps() to be callable in either context (eval or snap_deps) then have non-second-expansion targets call expand_deps() during eval, so that we only need to store that dependency list once.
* Another round of cleanups:Paul Smith2006-04-091-18/+18
| | | | | | | | - Add more warnings. - Rename variables that mask out-scope vars with the same name. - Remove all casts of return values from xmalloc, xrealloc, and alloca. - Remove casts of the first argument to xrealloc. - Convert all bcopy/bzero/bcmp invocations to use memcp/memmove/memset/memcmp.
* Release GNU make 3.81.Paul Smith2006-04-011-1/+1
| | | | | | | | | Update NEWS docs. Enhance the manual to use automake version.texi, and use the canonical FSF copyright features and statement. Some $(realpath ...) tests won't work on Windows; leave them out The jobserver filedescriptor test might fail if some FDs are reserved, so for now comment out that check.
* Fixed Savannah bug #16053.Boris Kolpackov2006-03-171-4/+32
|
* Last of the copyright updates.Paul Smith2006-02-111-1/+2
|
* More copyright/license updates.Paul Smith2006-02-111-14/+11
|
* Make second expansion optional (partial implementation).Paul Smith2005-10-241-1/+16
| | | | | | | | | | | | | | | | I decided this feature was too impacting to make the permanent default behavior. This set of changes makes the default behavior of make the old behavior (no second expansion). If you want second expansion, you must define the .SECONDEXPANSION: special target before the first target that needs it. This set of changes ONLY fixes explicit and static pattern rules to work like this. Implicit rules still have second expansion enabled all the time: I'll work on that next. Note that there is still a backward-incompatibility: now to get the old SysV behavior using $$@ etc. in the prerequisites list you need to set .SECONDEXPANSION: as well.
* Fix Savannah bug #1454: skip over semicolons (and comments) inside variablePaul Smith2005-06-251-16/+0
| | | | references in target definition lines.
* Fix Savannah bug # 1328: if stdout is redirected to a full filesystem, wePaul Smith2005-06-121-0/+47
| | | | | | | check for this and exit with an error. The closeout.c version from gnulib pulls in too much other stuff, and gnulib requires an ANSI C 89 compliant compiler, while GNU make (so far) still wants to work on K&R.
* * New feature: -L optionPaul Smith2005-02-281-2/+2
| | | | | | | | * New function: $(info ...) * Disallow $(eval ...) to create prereq relationships inside command scripts (caused core dumps) * Try to allow more tests to succeed in Windows/DOS by sanitizing CRLF and \ * Various bug fixes and code cleanups (see the ChangeLog entry)
* Implementation of the .DEFAULT_TARGET special variable.Boris Kolpackov2005-02-271-9/+9
|
* Implementation of the second expansion in explicitBoris Kolpackov2005-02-271-0/+21
| | | | rules, static pattern rules and implicit rules.
* Remove sindex() and replace with strstr().Paul Smith2004-09-211-28/+0
| | | | | Windows: allow users to set SHELL to cmd.exe and have it behave as if no UNIX shell were found.