Merge bmake-20100510diff -r1.8 -r1.9 pkgsrc/devel/bmake/files/ChangeLog
(joerg)
@@ -1,13 +1,37 @@ | @@ -1,13 +1,37 @@ | |||
1 | 2010-05-10 Simon J. Gerraty <sjg@bad.crufty.net> | |||
2 | ||||
3 | * boot-strap: use absolute path for bmake when running tests. | |||
4 | ||||
5 | * Makefile.in (MAKE_VERSION): bump version to 20100510 | |||
6 | Merge with NetBSD make, pick up | |||
7 | o revert use of realpath on argv[0] | |||
8 | too many corner cases. | |||
9 | o print MAKE_PRINT_VAR_ON_ERROR before running .ERROR target. | |||
10 | ||||
11 | 2010-05-05 Simon J. Gerraty <sjg@bad.crufty.net> | |||
12 | ||||
13 | * Makefile.in (MAKE_VERSION): bump version to 20100505 | |||
14 | Merge with NetBSD make, pick up | |||
15 | o fix for missed SIGCHLD when compiled with SunPRO | |||
16 | actually for bmake, defining FORCE_POSIX_SIGNALS would have | |||
17 | done the job. | |||
18 | ||||
19 | 2010-04-30 Simon J. Gerraty <sjg@bad.crufty.net> | |||
20 | ||||
21 | * Makefile.in (MAKE_VERSION): bump version to 20100430 | |||
22 | Merge with NetBSD make, pick up | |||
23 | o fflush stdout before writing to stdout | |||
24 | ||||
1 | 2010-04-23 Simon J. Gerraty <sjg@bad.crufty.net> | 25 | 2010-04-23 Simon J. Gerraty <sjg@bad.crufty.net> | |
2 | 26 | |||
3 | * Makefile.in (MAKE_VERSION): bump version to 20100423 | 27 | * Makefile.in (MAKE_VERSION): bump version to 20100423 | |
4 | Merge with NetBSD make, pick up | 28 | Merge with NetBSD make, pick up | |
5 | o updated unit tests for Haiku (this time for sure). | 29 | o updated unit tests for Haiku (this time for sure). | |
6 | * boot-strap: based on patch from joerg | 30 | * boot-strap: based on patch from joerg | |
7 | honor --with-default-sys-path better. | 31 | honor --with-default-sys-path better. | |
8 | * boot-strap: remove mention of --with-prefix-sys-path | 32 | * boot-strap: remove mention of --with-prefix-sys-path | |
9 | 33 | |||
10 | 2010-04-22 Simon J. Gerraty <sjg@bad.crufty.net> | 34 | 2010-04-22 Simon J. Gerraty <sjg@bad.crufty.net> | |
11 | 35 | |||
12 | * Makefile.in (MAKE_VERSION): bump version to 20100422 | 36 | * Makefile.in (MAKE_VERSION): bump version to 20100422 | |
13 | * Merge with NetBSD make, pick up | 37 | * Merge with NetBSD make, pick up |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: main.c,v 1.8 2010/04/24 21:10:29 joerg Exp $ */ | 1 | /* $NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | 4 | * Copyright (c) 1988, 1989, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -59,39 +59,39 @@ | @@ -59,39 +59,39 @@ | |||
59 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 59 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
60 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 60 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
61 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 61 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
62 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 62 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
63 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 63 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
64 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 64 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
65 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 65 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
66 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 66 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
67 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 67 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
68 | * SUCH DAMAGE. | 68 | * SUCH DAMAGE. | |
69 | */ | 69 | */ | |
70 | 70 | |||
71 | #ifndef MAKE_NATIVE | 71 | #ifndef MAKE_NATIVE | |
72 | static char rcsid[] = "$NetBSD: main.c,v 1.8 2010/04/24 21:10:29 joerg Exp $"; | 72 | static char rcsid[] = "$NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $"; | |
73 | #else | 73 | #else | |
74 | #include <sys/cdefs.h> | 74 | #include <sys/cdefs.h> | |
75 | #ifndef lint | 75 | #ifndef lint | |
76 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ | 76 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ | |
77 | The Regents of the University of California. All rights reserved."); | 77 | The Regents of the University of California. All rights reserved."); | |
78 | #endif /* not lint */ | 78 | #endif /* not lint */ | |
79 | 79 | |||
80 | #ifndef lint | 80 | #ifndef lint | |
81 | #if 0 | 81 | #if 0 | |
82 | static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; | 82 | static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; | |
83 | #else | 83 | #else | |
84 | __RCSID("$NetBSD: main.c,v 1.8 2010/04/24 21:10:29 joerg Exp $"); | 84 | __RCSID("$NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $"); | |
85 | #endif | 85 | #endif | |
86 | #endif /* not lint */ | 86 | #endif /* not lint */ | |
87 | #endif | 87 | #endif | |
88 | 88 | |||
89 | /*- | 89 | /*- | |
90 | * main.c -- | 90 | * main.c -- | |
91 | * The main file for this entire program. Exit routines etc | 91 | * The main file for this entire program. Exit routines etc | |
92 | * reside here. | 92 | * reside here. | |
93 | * | 93 | * | |
94 | * Utility functions defined in this file: | 94 | * Utility functions defined in this file: | |
95 | * Main_ParseArgLine Takes a line of arguments, breaks them and | 95 | * Main_ParseArgLine Takes a line of arguments, breaks them and | |
96 | * treats them as if they were given when first | 96 | * treats them as if they were given when first | |
97 | * invoked. Used by the parse module to implement | 97 | * invoked. Used by the parse module to implement | |
@@ -923,34 +923,27 @@ main(int argc, char **argv) | @@ -923,34 +923,27 @@ main(int argc, char **argv) | |||
923 | /* | 923 | /* | |
924 | * Initialize the parsing, directory and variable modules to prepare | 924 | * Initialize the parsing, directory and variable modules to prepare | |
925 | * for the reading of inclusion paths and variable settings on the | 925 | * for the reading of inclusion paths and variable settings on the | |
926 | * command line | 926 | * command line | |
927 | */ | 927 | */ | |
928 | 928 | |||
929 | /* | 929 | /* | |
930 | * Initialize various variables. | 930 | * Initialize various variables. | |
931 | * MAKE also gets this name, for compatibility | 931 | * MAKE also gets this name, for compatibility | |
932 | * .MAKEFLAGS gets set to the empty string just in case. | 932 | * .MAKEFLAGS gets set to the empty string just in case. | |
933 | * MFLAGS also gets initialized empty, for compatibility. | 933 | * MFLAGS also gets initialized empty, for compatibility. | |
934 | */ | 934 | */ | |
935 | Parse_Init(); | 935 | Parse_Init(); | |
936 | if (argv[0][0] == '/') { | 936 | p1 = argv[0]; | |
937 | p1 = argv[0]; | |||
938 | } else { | |||
939 | p1 = realpath(argv[0], mdpath); | |||
940 | if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) { | |||
941 | p1 = argv[0]; /* realpath failed */ | |||
942 | } | |||
943 | } | |||
944 | Var_Set("MAKE", p1, VAR_GLOBAL, 0); | 937 | Var_Set("MAKE", p1, VAR_GLOBAL, 0); | |
945 | Var_Set(".MAKE", p1, VAR_GLOBAL, 0); | 938 | Var_Set(".MAKE", p1, VAR_GLOBAL, 0); | |
946 | Var_Set(MAKEFLAGS, "", VAR_GLOBAL, 0); | 939 | Var_Set(MAKEFLAGS, "", VAR_GLOBAL, 0); | |
947 | Var_Set(MAKEOVERRIDES, "", VAR_GLOBAL, 0); | 940 | Var_Set(MAKEOVERRIDES, "", VAR_GLOBAL, 0); | |
948 | Var_Set("MFLAGS", "", VAR_GLOBAL, 0); | 941 | Var_Set("MFLAGS", "", VAR_GLOBAL, 0); | |
949 | Var_Set(".ALLTARGETS", "", VAR_GLOBAL, 0); | 942 | Var_Set(".ALLTARGETS", "", VAR_GLOBAL, 0); | |
950 | 943 | |||
951 | /* | 944 | /* | |
952 | * Set some other useful macros | 945 | * Set some other useful macros | |
953 | */ | 946 | */ | |
954 | { | 947 | { | |
955 | char tmp[64]; | 948 | char tmp[64]; | |
956 | const char *ep; | 949 | const char *ep; | |
@@ -1739,26 +1732,27 @@ bad: | @@ -1739,26 +1732,27 @@ bad: | |||
1739 | * Side Effects: | 1732 | * Side Effects: | |
1740 | * The message is printed. | 1733 | * The message is printed. | |
1741 | */ | 1734 | */ | |
1742 | /* VARARGS */ | 1735 | /* VARARGS */ | |
1743 | void | 1736 | void | |
1744 | Error(const char *fmt, ...) | 1737 | Error(const char *fmt, ...) | |
1745 | { | 1738 | { | |
1746 | va_list ap; | 1739 | va_list ap; | |
1747 | FILE *err_file; | 1740 | FILE *err_file; | |
1748 | 1741 | |||
1749 | err_file = debug_file; | 1742 | err_file = debug_file; | |
1750 | if (err_file == stdout) | 1743 | if (err_file == stdout) | |
1751 | err_file = stderr; | 1744 | err_file = stderr; | |
1745 | (void)fflush(stdout); | |||
1752 | for (;;) { | 1746 | for (;;) { | |
1753 | va_start(ap, fmt); | 1747 | va_start(ap, fmt); | |
1754 | fprintf(err_file, "%s: ", progname); | 1748 | fprintf(err_file, "%s: ", progname); | |
1755 | (void)vfprintf(err_file, fmt, ap); | 1749 | (void)vfprintf(err_file, fmt, ap); | |
1756 | va_end(ap); | 1750 | va_end(ap); | |
1757 | (void)fprintf(err_file, "\n"); | 1751 | (void)fprintf(err_file, "\n"); | |
1758 | (void)fflush(err_file); | 1752 | (void)fflush(err_file); | |
1759 | if (err_file == stderr) | 1753 | if (err_file == stderr) | |
1760 | break; | 1754 | break; | |
1761 | err_file = stderr; | 1755 | err_file = stderr; | |
1762 | } | 1756 | } | |
1763 | } | 1757 | } | |
1764 | 1758 | |||
@@ -1773,26 +1767,27 @@ Error(const char *fmt, ...) | @@ -1773,26 +1767,27 @@ Error(const char *fmt, ...) | |||
1773 | * Side Effects: | 1767 | * Side Effects: | |
1774 | * The program exits | 1768 | * The program exits | |
1775 | */ | 1769 | */ | |
1776 | /* VARARGS */ | 1770 | /* VARARGS */ | |
1777 | void | 1771 | void | |
1778 | Fatal(const char *fmt, ...) | 1772 | Fatal(const char *fmt, ...) | |
1779 | { | 1773 | { | |
1780 | va_list ap; | 1774 | va_list ap; | |
1781 | 1775 | |||
1782 | va_start(ap, fmt); | 1776 | va_start(ap, fmt); | |
1783 | if (jobsRunning) | 1777 | if (jobsRunning) | |
1784 | Job_Wait(); | 1778 | Job_Wait(); | |
1785 | 1779 | |||
1780 | (void)fflush(stdout); | |||
1786 | (void)vfprintf(stderr, fmt, ap); | 1781 | (void)vfprintf(stderr, fmt, ap); | |
1787 | va_end(ap); | 1782 | va_end(ap); | |
1788 | (void)fprintf(stderr, "\n"); | 1783 | (void)fprintf(stderr, "\n"); | |
1789 | (void)fflush(stderr); | 1784 | (void)fflush(stderr); | |
1790 | 1785 | |||
1791 | PrintOnError(NULL, NULL); | 1786 | PrintOnError(NULL, NULL); | |
1792 | 1787 | |||
1793 | if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) | 1788 | if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) | |
1794 | Targ_PrintGraph(2); | 1789 | Targ_PrintGraph(2); | |
1795 | Trace_Log(MAKEERROR, 0); | 1790 | Trace_Log(MAKEERROR, 0); | |
1796 | exit(2); /* Not 1 so -q can distinguish error */ | 1791 | exit(2); /* Not 1 so -q can distinguish error */ | |
1797 | } | 1792 | } | |
1798 | 1793 | |||
@@ -1804,26 +1799,27 @@ Fatal(const char *fmt, ...) | @@ -1804,26 +1799,27 @@ Fatal(const char *fmt, ...) | |||
1804 | * Results: | 1799 | * Results: | |
1805 | * None | 1800 | * None | |
1806 | * | 1801 | * | |
1807 | * Side Effects: | 1802 | * Side Effects: | |
1808 | * All children are killed indiscriminately and the program Lib_Exits | 1803 | * All children are killed indiscriminately and the program Lib_Exits | |
1809 | */ | 1804 | */ | |
1810 | /* VARARGS */ | 1805 | /* VARARGS */ | |
1811 | void | 1806 | void | |
1812 | Punt(const char *fmt, ...) | 1807 | Punt(const char *fmt, ...) | |
1813 | { | 1808 | { | |
1814 | va_list ap; | 1809 | va_list ap; | |
1815 | 1810 | |||
1816 | va_start(ap, fmt); | 1811 | va_start(ap, fmt); | |
1812 | (void)fflush(stdout); | |||
1817 | (void)fprintf(stderr, "%s: ", progname); | 1813 | (void)fprintf(stderr, "%s: ", progname); | |
1818 | (void)vfprintf(stderr, fmt, ap); | 1814 | (void)vfprintf(stderr, fmt, ap); | |
1819 | va_end(ap); | 1815 | va_end(ap); | |
1820 | (void)fprintf(stderr, "\n"); | 1816 | (void)fprintf(stderr, "\n"); | |
1821 | (void)fflush(stderr); | 1817 | (void)fflush(stderr); | |
1822 | 1818 | |||
1823 | PrintOnError(NULL, NULL); | 1819 | PrintOnError(NULL, NULL); | |
1824 | 1820 | |||
1825 | DieHorribly(); | 1821 | DieHorribly(); | |
1826 | } | 1822 | } | |
1827 | 1823 | |||
1828 | /*- | 1824 | /*- | |
1829 | * DieHorribly -- | 1825 | * DieHorribly -- | |
@@ -1950,43 +1946,42 @@ PrintOnError(GNode *gn, const char *s) | @@ -1950,43 +1946,42 @@ PrintOnError(GNode *gn, const char *s) | |||
1950 | if (s) | 1946 | if (s) | |
1951 | printf("%s", s); | 1947 | printf("%s", s); | |
1952 | 1948 | |||
1953 | printf("\n%s: stopped in %s\n", progname, curdir); | 1949 | printf("\n%s: stopped in %s\n", progname, curdir); | |
1954 | 1950 | |||
1955 | if (en) | 1951 | if (en) | |
1956 | return; /* we've been here! */ | 1952 | return; /* we've been here! */ | |
1957 | if (gn) { | 1953 | if (gn) { | |
1958 | /* | 1954 | /* | |
1959 | * We can print this even if there is no .ERROR target. | 1955 | * We can print this even if there is no .ERROR target. | |
1960 | */ | 1956 | */ | |
1961 | Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0); | 1957 | Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0); | |
1962 | } | 1958 | } | |
1959 | strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}", | |||
1960 | sizeof(tmp) - 1); | |||
1961 | cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0); | |||
1962 | if (cp) { | |||
1963 | if (*cp) | |||
1964 | printf("%s", cp); | |||
1965 | free(cp); | |||
1966 | } | |||
1963 | /* | 1967 | /* | |
1964 | * See if there is a .ERROR target, and run it if so. | 1968 | * Finally, see if there is a .ERROR target, and run it if so. | |
1965 | */ | 1969 | */ | |
1966 | en = Targ_FindNode(".ERROR", TARG_NOCREATE); | 1970 | en = Targ_FindNode(".ERROR", TARG_NOCREATE); | |
1967 | if (en) { | 1971 | if (en) { | |
1968 | en->type |= OP_SPECIAL; | 1972 | en->type |= OP_SPECIAL; | |
1969 | Compat_Make(en, en); | 1973 | Compat_Make(en, en); | |
1970 | } | 1974 | } | |
1971 | ||||
1972 | strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}", | |||
1973 | sizeof(tmp) - 1); | |||
1974 | cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0); | |||
1975 | if (cp) { | |||
1976 | if (*cp) | |||
1977 | printf("%s", cp); | |||
1978 | free(cp); | |||
1979 | } | |||
1980 | } | 1975 | } | |
1981 | 1976 | |||
1982 | void | 1977 | void | |
1983 | Main_ExportMAKEFLAGS(Boolean first) | 1978 | Main_ExportMAKEFLAGS(Boolean first) | |
1984 | { | 1979 | { | |
1985 | static int once = 1; | 1980 | static int once = 1; | |
1986 | char tmp[64]; | 1981 | char tmp[64]; | |
1987 | char *s; | 1982 | char *s; | |
1988 | 1983 | |||
1989 | if (once != first) | 1984 | if (once != first) | |
1990 | return; | 1985 | return; | |
1991 | once = 0; | 1986 | once = 0; | |
1992 | 1987 |
@@ -1,37 +1,37 @@ | @@ -1,37 +1,37 @@ | |||
1 | # $NetBSD: Makefile.in,v 1.16 2010/04/24 21:10:29 joerg Exp $ | 1 | # $NetBSD: Makefile.in,v 1.17 2010/05/13 18:43:07 joerg Exp $ | |
2 | # @(#)Makefile 5.2 (Berkeley) 12/28/90 | 2 | # @(#)Makefile 5.2 (Berkeley) 12/28/90 | |
3 | 3 | |||
4 | # $Id: Makefile.in,v 1.16 2010/04/24 21:10:29 joerg Exp $ | 4 | # $Id: Makefile.in,v 1.17 2010/05/13 18:43:07 joerg Exp $ | |
5 | 5 | |||
6 | PROG= bmake | 6 | PROG= bmake | |
7 | SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \ | 7 | SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \ | |
8 | make.c parse.c str.c suff.c targ.c trace.c var.c util.c | 8 | make.c parse.c str.c suff.c targ.c trace.c var.c util.c | |
9 | SRCS+= strlist.c | 9 | SRCS+= strlist.c | |
10 | SRCS+= make_malloc.c | 10 | SRCS+= make_malloc.c | |
11 | SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \ | 11 | SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \ | |
12 | lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \ | 12 | lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \ | |
13 | lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \ | 13 | lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \ | |
14 | lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \ | 14 | lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \ | |
15 | lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c | 15 | lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c | |
16 | SRCS += lstPrev.c | 16 | SRCS += lstPrev.c | |
17 | 17 | |||
18 | # you can use this Makefile if you have an earlier version of bmake. | 18 | # you can use this Makefile if you have an earlier version of bmake. | |
19 | prefix= @prefix@ | 19 | prefix= @prefix@ | |
20 | srcdir= @srcdir@ | 20 | srcdir= @srcdir@ | |
21 | CC?= @CC@ | 21 | CC?= @CC@ | |
22 | 22 | |||
23 | # Base version on src date | 23 | # Base version on src date | |
24 | MAKE_VERSION= 20100423 | 24 | MAKE_VERSION= 20100510 | |
25 | MACHINE=@machine@ | 25 | MACHINE=@machine@ | |
26 | MACHINE_ARCH=@machine_arch@ | 26 | MACHINE_ARCH=@machine_arch@ | |
27 | DEFAULT_SYS_PATH = @default_sys_path@ | 27 | DEFAULT_SYS_PATH = @default_sys_path@ | |
28 | 28 | |||
29 | NOMAN= yes | 29 | NOMAN= yes | |
30 | 30 | |||
31 | CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" | 31 | CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" | |
32 | CFLAGS+= -I. -I${srcdir} @DEFS@ @CPPFLAGS@ ${XDEFS} -DMAKE_NATIVE | 32 | CFLAGS+= -I. -I${srcdir} @DEFS@ @CPPFLAGS@ ${XDEFS} -DMAKE_NATIVE | |
33 | CFLAGS+= ${CFLAGS_${.TARGET:T}} | 33 | CFLAGS+= ${CFLAGS_${.TARGET:T}} | |
34 | CFLAGS_main.o= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" | 34 | CFLAGS_main.o= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" | |
35 | LDFLAGS= @LDFLAGS@ | 35 | LDFLAGS= @LDFLAGS@ | |
36 | LIBOBJS= @LIBOBJS@ | 36 | LIBOBJS= @LIBOBJS@ | |
37 | LDADD= @LIBS@ | 37 | LDADD= @LIBS@ | |
@@ -78,32 +78,32 @@ SUBDIR+= unit-tests | @@ -78,32 +78,32 @@ SUBDIR+= unit-tests | |||
78 | CC_IS_GCC=@GCC@ | 78 | CC_IS_GCC=@GCC@ | |
79 | .if ${CC_IS_GCC} == "yes" | 79 | .if ${CC_IS_GCC} == "yes" | |
80 | # problem with gcc3 | 80 | # problem with gcc3 | |
81 | CFLAGS_var.o+= -Wno-cast-qual | 81 | CFLAGS_var.o+= -Wno-cast-qual | |
82 | .endif | 82 | .endif | |
83 | 83 | |||
84 | CFLAGS_main.o+= "-D@force_machine@MACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\"" | 84 | CFLAGS_main.o+= "-D@force_machine@MACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\"" | |
85 | 85 | |||
86 | EXTRACT_MAN=no | 86 | EXTRACT_MAN=no | |
87 | 87 | |||
88 | .if exists(${srcdir}/../Makefile.inc) | 88 | .if exists(${srcdir}/../Makefile.inc) | |
89 | .include "${srcdir}/../Makefile.inc" | 89 | .include "${srcdir}/../Makefile.inc" | |
90 | .endif | 90 | .endif | |
91 | .include <bsd.prog.mk> | 91 | .-include <bsd.prog.mk> | |
92 | # sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk | 92 | # sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk | |
93 | # so the inclusion below, results in complaints about re-defined | 93 | # so the inclusion below, results in complaints about re-defined | |
94 | # targets. For NetBSD though we need to explicitly include it. | 94 | # targets. For NetBSD though we need to explicitly include it. | |
95 | .if defined(SUBDIR) && !target(${SUBDIR:[1]}) | 95 | .if defined(SUBDIR) && !target(${SUBDIR:[1]}) | |
96 | .include <bsd.subdir.mk> | 96 | .-include <bsd.subdir.mk> | |
97 | .endif | 97 | .endif | |
98 | 98 | |||
99 | # Force these | 99 | # Force these | |
100 | BINDIR= ${prefix}/bin | 100 | BINDIR= ${prefix}/bin | |
101 | MANDIR= ${prefix}/man | 101 | MANDIR= ${prefix}/man | |
102 | 102 | |||
103 | arch.o: config.h | 103 | arch.o: config.h | |
104 | # make sure that MAKE_VERSION gets updated. | 104 | # make sure that MAKE_VERSION gets updated. | |
105 | main.o: ${SRCS} ${MAKEFILE} | 105 | main.o: ${SRCS} ${MAKEFILE} | |
106 | 106 | |||
107 | MK?=${prefix}/share/mk | 107 | MK?=${prefix}/share/mk | |
108 | MKSRC?=@mksrc@ | 108 | MKSRC?=@mksrc@ | |
109 | INSTALL?=${srcdir}/install-sh | 109 | INSTALL?=${srcdir}/install-sh |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: bmake.1,v 1.5 2010/04/24 21:10:29 joerg Exp $ | 1 | .\" $NetBSD: bmake.1,v 1.6 2010/05/13 18:43:07 joerg Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 1990, 1993 | 3 | .\" Copyright (c) 1990, 1993 | |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | 7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | 8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | 12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | 13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" 3. Neither the name of the University nor the names of its contributors | 14 | .\" 3. Neither the name of the University nor the names of its contributors |
@@ -43,27 +43,27 @@ | @@ -43,27 +43,27 @@ | |||
43 | # | 43 | # | |
44 | # --with-machine_arch="machine_arch" | 44 | # --with-machine_arch="machine_arch" | |
45 | # set "machine_arch" to override that determined by | 45 | # set "machine_arch" to override that determined by | |
46 | # machine.sh | 46 | # machine.sh | |
47 | # | 47 | # | |
48 | # --with-default-sys-path="syspath" | 48 | # --with-default-sys-path="syspath" | |
49 | # set an explicit default "syspath" which is where bmake | 49 | # set an explicit default "syspath" which is where bmake | |
50 | # will look for sys.mk and friends. | 50 | # will look for sys.mk and friends. | |
51 | # | 51 | # | |
52 | # AUTHOR: | 52 | # AUTHOR: | |
53 | # Simon J. Gerraty <sjg@crufty.net> | 53 | # Simon J. Gerraty <sjg@crufty.net> | |
54 | 54 | |||
55 | # RCSid: | 55 | # RCSid: | |
56 | # $Id: boot-strap,v 1.7 2010/04/24 21:10:29 joerg Exp $ | 56 | # $Id: boot-strap,v 1.8 2010/05/13 18:43:08 joerg Exp $ | |
57 | # | 57 | # | |
58 | # @(#) Copyright (c) 2001 Simon J. Gerraty | 58 | # @(#) Copyright (c) 2001 Simon J. Gerraty | |
59 | # | 59 | # | |
60 | # This file is provided in the hope that it will | 60 | # This file is provided in the hope that it will | |
61 | # be of use. There is absolutely NO WARRANTY. | 61 | # be of use. There is absolutely NO WARRANTY. | |
62 | # Permission to copy, redistribute or otherwise | 62 | # Permission to copy, redistribute or otherwise | |
63 | # use this file is hereby granted provided that | 63 | # use this file is hereby granted provided that | |
64 | # the above copyright notice and this notice are | 64 | # the above copyright notice and this notice are | |
65 | # left intact. | 65 | # left intact. | |
66 | # | 66 | # | |
67 | # Please send copies of changes and bug-fixes to: | 67 | # Please send copies of changes and bug-fixes to: | |
68 | # sjg@crufty.net | 68 | # sjg@crufty.net | |
69 | # | 69 | # | |
@@ -284,32 +284,36 @@ if [ -z "$MAKESYSPATH" ]; then | @@ -284,32 +284,36 @@ if [ -z "$MAKESYSPATH" ]; then | |||
284 | add_path "${share_dir:-...}/mk" MAKESYSPATH | 284 | add_path "${share_dir:-...}/mk" MAKESYSPATH | |
285 | case "$HOST_TARGET" in | 285 | case "$HOST_TARGET" in | |
286 | netbsd*) add_path /usr/share/mk MAKESYSPATH;; | 286 | netbsd*) add_path /usr/share/mk MAKESYSPATH;; | |
287 | esac | 287 | esac | |
288 | fi | 288 | fi | |
289 | if [ -s "${mksrc:-/dev/null}/install-mk" ]; then | 289 | if [ -s "${mksrc:-/dev/null}/install-mk" ]; then | |
290 | sh "${mksrc}/install-mk" "$objdir/mk" | 290 | sh "${mksrc}/install-mk" "$objdir/mk" | |
291 | case "$MAKESYSPATH" in | 291 | case "$MAKESYSPATH" in | |
292 | .../mk*) ;; | 292 | .../mk*) ;; | |
293 | *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; | 293 | *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; | |
294 | esac | 294 | esac | |
295 | fi | 295 | fi | |
296 | export MAKESYSPATH | 296 | export MAKESYSPATH | |
297 | ./bmake test || exit 1 | 297 | if [ "$mksrc" ]; then | |
298 | 298 | $objdir/bmake test || exit 1 | ||
299 | else | |||
300 | # assume nothing | |||
301 | $objdir/bmake -r -m / test || exit 1 | |||
302 | fi | |||
299 | # If -q given, we don't want all the install instructions | 303 | # If -q given, we don't want all the install instructions | |
300 | $quiet exit 0 | 304 | $quiet exit 0 | |
301 | 305 | |||
302 | make_version=`./bmake -f ./Makefile -V MAKE_VERSION | ( read one two; echo $one )` | 306 | make_version=`./bmake -r -m / -f ./Makefile -V MAKE_VERSION | ( read one two; echo $one )` | |
303 | bmake_version=bmake-$make_version | 307 | bmake_version=bmake-$make_version | |
304 | 308 | |||
305 | if [ -s /usr/share/tmac/andoc.tmac ]; then | 309 | if [ -s /usr/share/tmac/andoc.tmac ]; then | |
306 | # this should be ok | 310 | # this should be ok | |
307 | man_subdir=man1 | 311 | man_subdir=man1 | |
308 | man_src=$srcdir/bmake.1 | 312 | man_src=$srcdir/bmake.1 | |
309 | else | 313 | else | |
310 | # guess not | 314 | # guess not | |
311 | man_subdir=cat1 | 315 | man_subdir=cat1 | |
312 | man_src=$srcdir/bmake.cat1 | 316 | man_src=$srcdir/bmake.cat1 | |
313 | fi | 317 | fi | |
314 | 318 | |||
315 | install_prefix() { | 319 | install_prefix() { |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: parse.c,v 1.6 2010/04/20 13:37:49 joerg Exp $ */ | 1 | /* $NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | 4 | * Copyright (c) 1988, 1989, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -59,34 +59,34 @@ | @@ -59,34 +59,34 @@ | |||
59 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 59 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
60 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 60 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
61 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 61 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
62 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 62 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
63 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 63 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
64 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 64 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
65 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 65 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
66 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 66 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
67 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 67 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
68 | * SUCH DAMAGE. | 68 | * SUCH DAMAGE. | |
69 | */ | 69 | */ | |
70 | 70 | |||
71 | #ifndef MAKE_NATIVE | 71 | #ifndef MAKE_NATIVE | |
72 | static char rcsid[] = "$NetBSD: parse.c,v 1.6 2010/04/20 13:37:49 joerg Exp $"; | 72 | static char rcsid[] = "$NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"; | |
73 | #else | 73 | #else | |
74 | #include <sys/cdefs.h> | 74 | #include <sys/cdefs.h> | |
75 | #ifndef lint | 75 | #ifndef lint | |
76 | #if 0 | 76 | #if 0 | |
77 | static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; | 77 | static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; | |
78 | #else | 78 | #else | |
79 | __RCSID("$NetBSD: parse.c,v 1.6 2010/04/20 13:37:49 joerg Exp $"); | 79 | __RCSID("$NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"); | |
80 | #endif | 80 | #endif | |
81 | #endif /* not lint */ | 81 | #endif /* not lint */ | |
82 | #endif | 82 | #endif | |
83 | 83 | |||
84 | /*- | 84 | /*- | |
85 | * parse.c -- | 85 | * parse.c -- | |
86 | * Functions to parse a makefile. | 86 | * Functions to parse a makefile. | |
87 | * | 87 | * | |
88 | * One function, Parse_Init, must be called before any functions | 88 | * One function, Parse_Init, must be called before any functions | |
89 | * in this module are used. After that, the function Parse_File is the | 89 | * in this module are used. After that, the function Parse_File is the | |
90 | * main entry point and controls most of the other functions in this | 90 | * main entry point and controls most of the other functions in this | |
91 | * module. | 91 | * module. | |
92 | * | 92 | * | |
@@ -441,26 +441,27 @@ ParseVErrorInternal(FILE *f, const char | @@ -441,26 +441,27 @@ ParseVErrorInternal(FILE *f, const char | |||
441 | * None | 441 | * None | |
442 | * | 442 | * | |
443 | * Side Effects: | 443 | * Side Effects: | |
444 | * None | 444 | * None | |
445 | */ | 445 | */ | |
446 | /* VARARGS */ | 446 | /* VARARGS */ | |
447 | static void | 447 | static void | |
448 | ParseErrorInternal(const char *cfname, size_t clineno, int type, | 448 | ParseErrorInternal(const char *cfname, size_t clineno, int type, | |
449 | const char *fmt, ...) | 449 | const char *fmt, ...) | |
450 | { | 450 | { | |
451 | va_list ap; | 451 | va_list ap; | |
452 | 452 | |||
453 | va_start(ap, fmt); | 453 | va_start(ap, fmt); | |
454 | (void)fflush(stdout); | |||
454 | ParseVErrorInternal(stderr, cfname, clineno, type, fmt, ap); | 455 | ParseVErrorInternal(stderr, cfname, clineno, type, fmt, ap); | |
455 | va_end(ap); | 456 | va_end(ap); | |
456 | 457 | |||
457 | if (debug_file != stderr && debug_file != stdout) { | 458 | if (debug_file != stderr && debug_file != stdout) { | |
458 | va_start(ap, fmt); | 459 | va_start(ap, fmt); | |
459 | ParseVErrorInternal(debug_file, cfname, clineno, type, fmt, ap); | 460 | ParseVErrorInternal(debug_file, cfname, clineno, type, fmt, ap); | |
460 | va_end(ap); | 461 | va_end(ap); | |
461 | } | 462 | } | |
462 | } | 463 | } | |
463 | 464 | |||
464 | /*- | 465 | /*- | |
465 | * Parse_Error -- | 466 | * Parse_Error -- | |
466 | * External interface to ParseErrorInternal; uses the default filename | 467 | * External interface to ParseErrorInternal; uses the default filename | |
@@ -479,26 +480,27 @@ Parse_Error(int type, const char *fmt, . | @@ -479,26 +480,27 @@ Parse_Error(int type, const char *fmt, . | |||
479 | va_list ap; | 480 | va_list ap; | |
480 | const char *fname; | 481 | const char *fname; | |
481 | size_t lineno; | 482 | size_t lineno; | |
482 | 483 | |||
483 | if (curFile == NULL) { | 484 | if (curFile == NULL) { | |
484 | fname = NULL; | 485 | fname = NULL; | |
485 | lineno = 0; | 486 | lineno = 0; | |
486 | } else { | 487 | } else { | |
487 | fname = curFile->fname; | 488 | fname = curFile->fname; | |
488 | lineno = curFile->lineno; | 489 | lineno = curFile->lineno; | |
489 | } | 490 | } | |
490 | 491 | |||
491 | va_start(ap, fmt); | 492 | va_start(ap, fmt); | |
493 | (void)fflush(stdout); | |||
492 | ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); | 494 | ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); | |
493 | va_end(ap); | 495 | va_end(ap); | |
494 | 496 | |||
495 | if (debug_file != stderr && debug_file != stdout) { | 497 | if (debug_file != stderr && debug_file != stdout) { | |
496 | va_start(ap, fmt); | 498 | va_start(ap, fmt); | |
497 | ParseVErrorInternal(debug_file, fname, lineno, type, fmt, ap); | 499 | ParseVErrorInternal(debug_file, fname, lineno, type, fmt, ap); | |
498 | va_end(ap); | 500 | va_end(ap); | |
499 | } | 501 | } | |
500 | } | 502 | } | |
501 | 503 | |||
502 | 504 | |||
503 | /* | 505 | /* | |
504 | * ParseMessage | 506 | * ParseMessage | |
@@ -2702,26 +2704,27 @@ Parse_File(const char *name, int fd) | @@ -2702,26 +2704,27 @@ Parse_File(const char *name, int fd) | |||
2702 | free(line); | 2704 | free(line); | |
2703 | 2705 | |||
2704 | /* If there were commands after a ';', add them now */ | 2706 | /* If there were commands after a ';', add them now */ | |
2705 | if (cp != NULL) { | 2707 | if (cp != NULL) { | |
2706 | goto shellCommand; | 2708 | goto shellCommand; | |
2707 | } | 2709 | } | |
2708 | } | 2710 | } | |
2709 | /* | 2711 | /* | |
2710 | * Reached EOF, but it may be just EOF of an include file... | 2712 | * Reached EOF, but it may be just EOF of an include file... | |
2711 | */ | 2713 | */ | |
2712 | } while (ParseEOF() == CONTINUE); | 2714 | } while (ParseEOF() == CONTINUE); | |
2713 | 2715 | |||
2714 | if (fatals) { | 2716 | if (fatals) { | |
2717 | (void)fflush(stdout); | |||
2715 | (void)fprintf(stderr, | 2718 | (void)fprintf(stderr, | |
2716 | "%s: Fatal errors encountered -- cannot continue\n", | 2719 | "%s: Fatal errors encountered -- cannot continue\n", | |
2717 | progname); | 2720 | progname); | |
2718 | PrintOnError(NULL, NULL); | 2721 | PrintOnError(NULL, NULL); | |
2719 | exit(1); | 2722 | exit(1); | |
2720 | } | 2723 | } | |
2721 | } | 2724 | } | |
2722 | 2725 | |||
2723 | /*- | 2726 | /*- | |
2724 | *--------------------------------------------------------------------- | 2727 | *--------------------------------------------------------------------- | |
2725 | * Parse_Init -- | 2728 | * Parse_Init -- | |
2726 | * initialize the parsing module | 2729 | * initialize the parsing module | |
2727 | * | 2730 | * |
@@ -1,28 +1,28 @@ | @@ -1,28 +1,28 @@ | |||
1 | /* $NetBSD: util.c,v 1.6 2010/04/20 13:37:49 joerg Exp $ */ | 1 | /* $NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Missing stuff from OS's | 4 | * Missing stuff from OS's | |
5 | * | 5 | * | |
6 | * $Id: util.c,v 1.6 2010/04/20 13:37:49 joerg Exp $ | 6 | * $Id: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ | |
7 | */ | 7 | */ | |
8 | 8 | |||
9 | #include "make.h" | 9 | #include "make.h" | |
10 | 10 | |||
11 | #ifndef MAKE_NATIVE | 11 | #ifndef MAKE_NATIVE | |
12 | static char rcsid[] = "$NetBSD: util.c,v 1.6 2010/04/20 13:37:49 joerg Exp $"; | 12 | static char rcsid[] = "$NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"; | |
13 | #else | 13 | #else | |
14 | #ifndef lint | 14 | #ifndef lint | |
15 | __RCSID("$NetBSD: util.c,v 1.6 2010/04/20 13:37:49 joerg Exp $"); | 15 | __RCSID("$NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"); | |
16 | #endif | 16 | #endif | |
17 | #endif | 17 | #endif | |
18 | 18 | |||
19 | #include <errno.h> | 19 | #include <errno.h> | |
20 | #include <time.h> | 20 | #include <time.h> | |
21 | 21 | |||
22 | #if !defined(HAVE_STRERROR) | 22 | #if !defined(HAVE_STRERROR) | |
23 | extern int errno, sys_nerr; | 23 | extern int errno, sys_nerr; | |
24 | extern char *sys_errlist[]; | 24 | extern char *sys_errlist[]; | |
25 | 25 | |||
26 | char * | 26 | char * | |
27 | strerror(int e) | 27 | strerror(int e) | |
28 | { | 28 | { | |
@@ -375,45 +375,51 @@ getwd(char *pathname) | @@ -375,45 +375,51 @@ getwd(char *pathname) | |||
375 | 375 | |||
376 | #endif /* __hpux */ | 376 | #endif /* __hpux */ | |
377 | 377 | |||
378 | #if !defined(HAVE_GETCWD) | 378 | #if !defined(HAVE_GETCWD) | |
379 | char * | 379 | char * | |
380 | getcwd(path, sz) | 380 | getcwd(path, sz) | |
381 | char *path; | 381 | char *path; | |
382 | int sz; | 382 | int sz; | |
383 | { | 383 | { | |
384 | return getwd(path); | 384 | return getwd(path); | |
385 | } | 385 | } | |
386 | #endif | 386 | #endif | |
387 | 387 | |||
388 | #if defined(sun) && defined(__svr4__) && !defined(FORCE_POSIX_SIGNALS) | 388 | #if !defined(FORCE_POSIX_SIGNALS) | |
389 | /* | |||
390 | * If FORCE_POSIX_SIGNALS is defined | |||
391 | * then sigcompat will have done this. | |||
392 | */ | |||
393 | #if defined(sun) && (defined(__svr4__) || defined(__SVR4)) | |||
389 | #include <signal.h> | 394 | #include <signal.h> | |
390 | 395 | |||
391 | /* turn into bsd signals */ | 396 | /* turn into bsd signals */ | |
392 | void (* | 397 | void (* | |
393 | signal(int s, void (*a)(int)))(int) | 398 | signal(int s, void (*a)(int)))(int) | |
394 | { | 399 | { | |
395 | struct sigaction sa, osa; | 400 | struct sigaction sa, osa; | |
396 | 401 | |||
397 | sa.sa_handler = a; | 402 | sa.sa_handler = a; | |
398 | sigemptyset(&sa.sa_mask); | 403 | sigemptyset(&sa.sa_mask); | |
399 | sa.sa_flags = SA_RESTART; | 404 | sa.sa_flags = SA_RESTART; | |
400 | 405 | |||
401 | if (sigaction(s, &sa, &osa) == -1) | 406 | if (sigaction(s, &sa, &osa) == -1) | |
402 | return SIG_ERR; | 407 | return SIG_ERR; | |
403 | else | 408 | else | |
404 | return osa.sa_handler; | 409 | return osa.sa_handler; | |
405 | } | 410 | } | |
406 | #endif | 411 | #endif | |
412 | #endif | |||
407 | 413 | |||
408 | #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_VASPRINTF) | 414 | #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_VASPRINTF) | |
409 | #include <stdarg.h> | 415 | #include <stdarg.h> | |
410 | #endif | 416 | #endif | |
411 | 417 | |||
412 | #if !defined(HAVE_VSNPRINTF) | 418 | #if !defined(HAVE_VSNPRINTF) | |
413 | #if !defined(__osf__) | 419 | #if !defined(__osf__) | |
414 | #ifdef _IOSTRG | 420 | #ifdef _IOSTRG | |
415 | #define STRFLAG (_IOSTRG|_IOWRT) /* no _IOWRT: avoid stdio bug */ | 421 | #define STRFLAG (_IOSTRG|_IOWRT) /* no _IOWRT: avoid stdio bug */ | |
416 | #else | 422 | #else | |
417 | #if 0 | 423 | #if 0 | |
418 | #define STRFLAG (_IOREAD) /* XXX: Assume svr4 stdio */ | 424 | #define STRFLAG (_IOREAD) /* XXX: Assume svr4 stdio */ | |
419 | #endif | 425 | #endif |