diff options
author | briggs <briggs@cvs.openbsd.org> | 1996-09-02 16:04:23 +0000 |
---|---|---|
committer | briggs <briggs@cvs.openbsd.org> | 1996-09-02 16:04:23 +0000 |
commit | 9150de05a8f19f682fd7c79d1eac7110e77502cc (patch) | |
tree | 9b6b4c8273ec82e564c60b60ff6dc55f377f7be1 /usr.bin/make/util.c | |
parent | a64dba30d8dda4d3d00f553662090e44b77462db (diff) |
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.
Diffstat (limited to 'usr.bin/make/util.c')
-rw-r--r-- | usr.bin/make/util.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index 767551e9434..302317386bf 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.3 1996/06/26 05:36:38 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.4 1996/09/02 16:04:21 briggs Exp $ */ /* $NetBSD: util.c,v 1.5 1995/11/22 17:40:17 christos Exp $ */ /* @@ -7,7 +7,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.3 1996/06/26 05:36:38 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.4 1996/09/02 16:04:21 briggs Exp $"; #endif #include <stdio.h> @@ -40,7 +40,32 @@ strerror(e) } #endif -#if defined(sun) || defined(__hpux) +#ifdef ultrix +#include <string.h> + +/* strdup + * + * Make a duplicate of a string. + * For systems which lack this function. + */ +char * +strdup(str) + const char *str; +{ + size_t len; + + if (str == NULL) + return NULL; + len = strlen(str) + 1; + if ((p = malloc(len)) == NULL) + return NULL; + + return memcpy(p, str, len); +} + +#endif + +#if defined(sun) || defined(__hpux) || defined(__sgi) int setenv(name, value, dum) |