Deleted Added
full compact
main.c (255253) main.c (261212)
1/* $NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $ */
1/* $NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $ */
2
3/*
4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

--- 54 unchanged lines hidden (view full) ---

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
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
68 * SUCH DAMAGE.
69 */
70
71#ifndef MAKE_NATIVE
2
3/*
4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

--- 54 unchanged lines hidden (view full) ---

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
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
68 * SUCH DAMAGE.
69 */
70
71#ifndef MAKE_NATIVE
72static char rcsid[] = "$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $";
72static char rcsid[] = "$NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $";
73#else
74#include <sys/cdefs.h>
75#ifndef lint
76__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
77 The Regents of the University of California. All rights reserved.");
78#endif /* not lint */
79
80#ifndef lint
81#if 0
82static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
83#else
73#else
74#include <sys/cdefs.h>
75#ifndef lint
76__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
77 The Regents of the University of California. All rights reserved.");
78#endif /* not lint */
79
80#ifndef lint
81#if 0
82static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
83#else
84__RCSID("$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $");
84__RCSID("$NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $");
85#endif
86#endif /* not lint */
87#endif
88
89/*-
90 * main.c --
91 * The main file for this entire program. Exit routines etc
92 * reside here.

--- 20 unchanged lines hidden (view full) ---

113 * exiting.
114 */
115
116#include <sys/types.h>
117#include <sys/time.h>
118#include <sys/param.h>
119#include <sys/resource.h>
120#include <sys/stat.h>
85#endif
86#endif /* not lint */
87#endif
88
89/*-
90 * main.c --
91 * The main file for this entire program. Exit routines etc
92 * reside here.

--- 20 unchanged lines hidden (view full) ---

113 * exiting.
114 */
115
116#include <sys/types.h>
117#include <sys/time.h>
118#include <sys/param.h>
119#include <sys/resource.h>
120#include <sys/stat.h>
121#if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL)
122#include <sys/sysctl.h>
123#endif
121#include <sys/utsname.h>
122#include "wait.h"
123
124#include <errno.h>
125#include <fcntl.h>
126#include <signal.h>
127#include <stdarg.h>
128#include <stdio.h>

--- 11 unchanged lines hidden (view full) ---

140#ifdef USE_IOVEC
141#include <sys/uio.h>
142#endif
143
144#ifndef DEFMAXLOCAL
145#define DEFMAXLOCAL DEFMAXJOBS
146#endif /* DEFMAXLOCAL */
147
124#include <sys/utsname.h>
125#include "wait.h"
126
127#include <errno.h>
128#include <fcntl.h>
129#include <signal.h>
130#include <stdarg.h>
131#include <stdio.h>

--- 11 unchanged lines hidden (view full) ---

143#ifdef USE_IOVEC
144#include <sys/uio.h>
145#endif
146
147#ifndef DEFMAXLOCAL
148#define DEFMAXLOCAL DEFMAXJOBS
149#endif /* DEFMAXLOCAL */
150
151#ifndef __arraycount
152# define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
153#endif
154
148Lst create; /* Targets to be made */
149time_t now; /* Time at start of make */
150GNode *DEFAULT; /* .DEFAULT node */
151Boolean allPrecious; /* .PRECIOUS given on line by itself */
152
153static Boolean noBuiltins; /* -r flag */
154static Lst makefiles; /* ordered list of makefiles to read */
155static Boolean printVars; /* print value of one or more vars */

--- 749 unchanged lines hidden (view full) ---

905 machine = MAKE_MACHINE;
906#else
907 machine = "unknown";
908#endif
909#endif
910 }
911
912 if (!machine_arch) {
155Lst create; /* Targets to be made */
156time_t now; /* Time at start of make */
157GNode *DEFAULT; /* .DEFAULT node */
158Boolean allPrecious; /* .PRECIOUS given on line by itself */
159
160static Boolean noBuiltins; /* -r flag */
161static Lst makefiles; /* ordered list of makefiles to read */
162static Boolean printVars; /* print value of one or more vars */

--- 749 unchanged lines hidden (view full) ---

912 machine = MAKE_MACHINE;
913#else
914 machine = "unknown";
915#endif
916#endif
917 }
918
919 if (!machine_arch) {
920#if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL) && defined(CTL_HW) && defined(HW_MACHINE_ARCH)
921 static char machine_arch_buf[sizeof(utsname.machine)];
922 int mib[2] = { CTL_HW, HW_MACHINE_ARCH };
923 size_t len = sizeof(machine_arch_buf);
924
925 if (sysctl(mib, __arraycount(mib), machine_arch_buf,
926 &len, NULL, 0) < 0) {
927 (void)fprintf(stderr, "%s: sysctl failed (%s).\n", progname,
928 strerror(errno));
929 exit(2);
930 }
931
932 machine_arch = machine_arch_buf;
933#else
913#ifndef MACHINE_ARCH
914#ifdef MAKE_MACHINE_ARCH
915 machine_arch = MAKE_MACHINE_ARCH;
916#else
917 machine_arch = "unknown";
918#endif
919#else
920 machine_arch = MACHINE_ARCH;
921#endif
934#ifndef MACHINE_ARCH
935#ifdef MAKE_MACHINE_ARCH
936 machine_arch = MAKE_MACHINE_ARCH;
937#else
938 machine_arch = "unknown";
939#endif
940#else
941 machine_arch = MACHINE_ARCH;
942#endif
943#endif
922 }
923
924 myPid = getpid(); /* remember this for vFork() */
925
926 /*
927 * Just in case MAKEOBJDIR wants us to do something tricky.
928 */
929 Var_Init(); /* Initialize the lists of variables for

--- 1063 unchanged lines hidden ---
944 }
945
946 myPid = getpid(); /* remember this for vFork() */
947
948 /*
949 * Just in case MAKEOBJDIR wants us to do something tricky.
950 */
951 Var_Init(); /* Initialize the lists of variables for

--- 1063 unchanged lines hidden ---