diff options
author | bsiegert <bsiegert@pkgsrc.org> | 2011-06-18 22:17:41 +0000 |
---|---|---|
committer | bsiegert <bsiegert@pkgsrc.org> | 2011-06-18 22:17:41 +0000 |
commit | 7cb16bb66575467ac59352068eaec344242b439a (patch) | |
tree | c8f5dd7d540977ec601c02e7d04c13e80115f641 /devel/bmake/files/util.c | |
parent | 92219014db9b676e01e78bbe73c3877f94f2a471 (diff) | |
download | pkgsrc-7cb16bb66575467ac59352068eaec344242b439a.tar.gz |
Import bmake-20110606. Many changes, among them:
- unit-tests/modts now works on MirBSD
- meta mode
- ApplyModifiers: when we parse a variable which is not the entire modifier
string, or not followed by ':', do not consider it as containing modifiers.
- when long modifiers fail to match, check sysV style.
- :hash - cheap 32bit hash of value
- :localtime, :gmtime - use value as format string for strftime.
- fix for use after free() in CondDoExists().
- boot-strap (TOOL_DIFF): aparently at least on linux distro
formats the output of 'type' differently - so eat any "()"
- correct sysV substitution handling of empty lhs and variable
- correct exists() check for dir with trailing /
- correct handling of modifiers for non-existant variables during evaluation
of conditionals.
- fix for incorrect .PARSEDIR when .OBJDIR is re-computed after makefiles
have been read.
- fix example of :? modifier in man page.
- sigcompat.c: convert to ansi so we can use higher warning levels.
- parse.c: SunOS 5.8 at least does not have MAP_FILE
- use mmap(2) if available, for reading makefiles
- to ensure unit-tests results match, need to control LC_ALL as well as LANG.
- if stale dependency is an IMPSRC, search via .PATH
- machine.sh: like os.sh, allow for uname -p producing useless drivel
- boot-strap: document configure knobs for meta and filemon.
Diffstat (limited to 'devel/bmake/files/util.c')
-rw-r--r-- | devel/bmake/files/util.c | 97 |
1 files changed, 92 insertions, 5 deletions
diff --git a/devel/bmake/files/util.c b/devel/bmake/files/util.c index cb6b055e6d7..89210546bf3 100644 --- a/devel/bmake/files/util.c +++ b/devel/bmake/files/util.c @@ -1,18 +1,18 @@ -/* $NetBSD: util.c,v 1.1.1.8 2010/09/07 14:12:10 joerg Exp $ */ +/* $NetBSD: util.c,v 1.1.1.9 2011/06/18 22:18:10 bsiegert Exp $ */ /* * Missing stuff from OS's * - * $Id: util.c,v 1.1.1.8 2010/09/07 14:12:10 joerg Exp $ + * $Id: util.c,v 1.1.1.9 2011/06/18 22:18:10 bsiegert Exp $ */ #include "make.h" #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: util.c,v 1.1.1.8 2010/09/07 14:12:10 joerg Exp $"; +static char rcsid[] = "$NetBSD: util.c,v 1.1.1.9 2011/06/18 22:18:10 bsiegert Exp $"; #else #ifndef lint -__RCSID("$NetBSD: util.c,v 1.1.1.8 2010/09/07 14:12:10 joerg Exp $"); +__RCSID("$NetBSD: util.c,v 1.1.1.9 2011/06/18 22:18:10 bsiegert Exp $"); #endif #endif @@ -47,7 +47,7 @@ findenv(const char *name, int *offset) char *p, *q; for (i = 0; (q = environ[i]); i++) { - char *p = strchr(q, '='); + p = strchr(q, '='); if (p == NULL) continue; if (strncmp(name, q, len = p - q) == 0) { @@ -526,3 +526,90 @@ killpg(int pid, int sig) } #endif #endif + +#if !defined(HAVE_WARNX) +static void +vwarnx(const char *fmt, va_list args) +{ + fprintf(stderr, "%s: ", progname); + if ((fmt)) { + vfprintf(stderr, fmt, args); + fprintf(stderr, ": "); + } +} +#endif + +#if !defined(HAVE_WARN) +static void +vwarn(const char *fmt, va_list args) +{ + vwarnx(fmt, args); + fprintf(stderr, "%s\n", strerror(errno)); +} +#endif + +#if !defined(HAVE_ERR) +static void +verr(int eval, const char *fmt, va_list args) +{ + vwarn(fmt, args); + exit(eval); +} +#endif + +#if !defined(HAVE_ERRX) +static void +verrx(int eval, const char *fmt, va_list args) +{ + vwarnx(fmt, args); + exit(eval); +} +#endif + +#if !defined(HAVE_ERR) +void +err(int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + verr(eval, fmt, ap); + va_end(ap); +} +#endif + +#if !defined(HAVE_ERRX) +void +errx(int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + verrx(eval, fmt, ap); + va_end(ap); +} +#endif + +#if !defined(HAVE_WARN) +void +warn(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwarn(fmt, ap); + va_end(ap); +} +#endif + +#if !defined(HAVE_WARNX) +void +warnx(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwarnx(fmt, ap); + va_end(ap); +} +#endif |