CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:52:51 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): clean up documentation of Main_ParseArgLine The previous documentation contained lots of irrelevant implementation details. To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.360 src/usr.bin/make/main.c:1.361 --- src/usr.bin/make/main.c:1.360 Thu Oct 1 23:44:36 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:52:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.360 2020/10/01 23:44:36 rillig Exp $ */ +/* $NetBSD: main.c,v 1.361 2020/10/01 23:52:51 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.360 2020/10/01 23:44:36 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.361 2020/10/01 23:52:51 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -691,24 +691,10 @@ noarg: usage(); } -/*- - * Main_ParseArgLine -- - * Used by the parse module when a .MFLAGS or .MAKEFLAGS target - * is encountered and by main() when reading the .MAKEFLAGS envariable. - * Takes a line of arguments and breaks it into its - * component words and passes those words and the number of them to the - * MainParseArgs function. - * The line should have all its leading whitespace removed. - * - * Input: - * line Line to fracture +/* Break a line of arguments into words and parse them. * - * Results: - * None - * - * Side Effects: - * Only those that come from the various arguments. - */ + * Used when a .MFLAGS or .MAKEFLAGS target is encountered during parsing and + * by main() when reading the MAKEFLAGS environment variable. */ void Main_ParseArgLine(const char *line) {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:44:36 UTC 2020 Modified Files: src/usr.bin/make: main.c nonints.h parse.c Log Message: make(1): add missing const for Parse_AddIncludeDir To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/main.c cvs rdiff -u -r1.132 -r1.133 src/usr.bin/make/nonints.h cvs rdiff -u -r1.343 -r1.344 src/usr.bin/make/parse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.359 src/usr.bin/make/main.c:1.360 --- src/usr.bin/make/main.c:1.359 Thu Oct 1 23:42:22 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:44:36 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.359 2020/10/01 23:42:22 rillig Exp $ */ +/* $NetBSD: main.c,v 1.360 2020/10/01 23:44:36 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.359 2020/10/01 23:42:22 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.360 2020/10/01 23:44:36 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -475,7 +475,7 @@ MainParseArgSysInc(const char *argvalue) } static Boolean -MainParseArg(char c, char *argvalue) +MainParseArg(char c, const char *argvalue) { switch (c) { case '\0': @@ -603,7 +603,7 @@ MainParseArg(char c, char *argvalue) static void MainParseArgs(int argc, char **argv) { - char c = '?'; + char c; int arginc; char *argvalue; char *optscan; Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.132 src/usr.bin/make/nonints.h:1.133 --- src/usr.bin/make/nonints.h:1.132 Sun Sep 27 11:37:19 2020 +++ src/usr.bin/make/nonints.h Thu Oct 1 23:44:36 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.132 2020/09/27 11:37:19 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.133 2020/10/01 23:44:36 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -123,7 +123,7 @@ char *cached_realpath(const char *, char void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); Boolean Parse_IsVar(const char *); void Parse_DoVar(char *, GNode *); -void Parse_AddIncludeDir(char *); +void Parse_AddIncludeDir(const char *); void Parse_File(const char *, int); void Parse_Init(void); void Parse_End(void); Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.343 src/usr.bin/make/parse.c:1.344 --- src/usr.bin/make/parse.c:1.343 Mon Sep 28 23:13:57 2020 +++ src/usr.bin/make/parse.c Thu Oct 1 23:44:36 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.343 2020/09/28 23:13:57 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.344 2020/10/01 23:44:36 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -132,7 +132,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.343 2020/09/28 23:13:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.344 2020/10/01 23:44:36 rillig Exp $"); /* types and constants */ @@ -2031,7 +2031,7 @@ ParseHasCommands(void *gnp) /* Add a directory to the path searched for included makefiles bracketed * by double-quotes. */ void -Parse_AddIncludeDir(char *dir) +Parse_AddIncludeDir(const char *dir) { (void)Dir_AddDir(parseIncPath, dir); }
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:42:22 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): clean up option handling The test for argvalue == NULL for the individual options was unnecessary since that is already done in the common part. To generate a diff of this commit: cvs rdiff -u -r1.358 -r1.359 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.358 src/usr.bin/make/main.c:1.359 --- src/usr.bin/make/main.c:1.358 Thu Oct 1 23:28:01 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:42:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.358 2020/10/01 23:28:01 rillig Exp $ */ +/* $NetBSD: main.c,v 1.359 2020/10/01 23:42:22 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.358 2020/10/01 23:28:01 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.359 2020/10/01 23:42:22 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -489,19 +489,17 @@ MainParseArg(char c, char *argvalue) MainParseArgChdir(argvalue); break; case 'D': - if (argvalue == NULL || argvalue[0] == 0) return FALSE; + if (argvalue[0] == '\0') return FALSE; Var_Set(argvalue, "1", VAR_GLOBAL); Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL); Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); break; case 'I': - if (argvalue == NULL) return FALSE; Parse_AddIncludeDir(argvalue); Var_Append(MAKEFLAGS, "-I", VAR_GLOBAL); Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); break; case 'J': - if (argvalue == NULL) return FALSE; MainParseArgJobsInternal(argvalue); break; case 'N': @@ -514,14 +512,12 @@ MainParseArg(char c, char *argvalue) Var_Append(MAKEFLAGS, "-S", VAR_GLOBAL); break; case 'T': - if (argvalue == NULL) return FALSE; tracefile = bmake_strdup(argvalue); Var_Append(MAKEFLAGS, "-T", VAR_GLOBAL); Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); break; case 'V': case 'v': - if (argvalue == NULL) return FALSE; printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS; Lst_Append(variables, bmake_strdup(argvalue)); Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); @@ -535,7 +531,6 @@ MainParseArg(char c, char *argvalue) Var_Append(MAKEFLAGS, "-X", VAR_GLOBAL); break; case 'd': - if (argvalue == NULL) return FALSE; /* If '-d-opts' don't pass to children */ if (argvalue[0] == '-') argvalue++; @@ -550,7 +545,6 @@ MainParseArg(char c, char *argvalue) Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL); break; case 'f': - if (argvalue == NULL) return FALSE; Lst_Append(makefiles, bmake_strdup(argvalue)); break; case 'i': @@ -558,7 +552,6 @@ MainParseArg(char c, char *argvalue) Var_Append(MAKEFLAGS, "-i", VAR_GLOBAL); break; case 'j': - if (argvalue == NULL) return FALSE; MainParseArgJobs(argvalue); break; case 'k': @@ -566,7 +559,6 @@ MainParseArg(char c, char *argvalue) Var_Append(MAKEFLAGS, "-k", VAR_GLOBAL); break; case 'm': - if (argvalue == NULL) return FALSE; MainParseArgSysInc(argvalue); break; case 'n': @@ -614,19 +606,17 @@ MainParseArgs(int argc, char **argv) char c = '?'; int arginc; char *argvalue; - const char *getopt_def; char *optscan; Boolean inOption, dashDash = FALSE; -#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w" + const char *optspecs = "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w"; /* Can't actually use getopt(3) because rescanning is not portable */ - getopt_def = OPTFLAGS; rearg: inOption = FALSE; optscan = NULL; while (argc > 1) { - char *getopt_spec; + const char *optspec; if (!inOption) optscan = argv[1]; c = *optscan++; @@ -645,8 +635,8 @@ rearg: c = *optscan++; } /* '-' found at some earlier point */ - getopt_spec = strchr(getopt_def, c); - if (c != '\0' && getopt_spec != NULL && getopt_spec[1] == ':') { + optspec = strchr(optspecs, c); + if (c != '\0' && optspec != NULL && optspec[1] == ':') { /* - found, and should have an arg */ inOption = FALSE; arginc = 1;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:28:01 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): format code in MainParseArgs To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.357 src/usr.bin/make/main.c:1.358 --- src/usr.bin/make/main.c:1.357 Thu Oct 1 23:20:48 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:28:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.357 2020/10/01 23:20:48 rillig Exp $ */ +/* $NetBSD: main.c,v 1.358 2020/10/01 23:28:01 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.357 2020/10/01 23:20:48 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.358 2020/10/01 23:28:01 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -625,14 +625,14 @@ MainParseArgs(int argc, char **argv) rearg: inOption = FALSE; optscan = NULL; - while(argc > 1) { + while (argc > 1) { char *getopt_spec; - if(!inOption) + if (!inOption) optscan = argv[1]; c = *optscan++; arginc = 0; - if(inOption) { - if(c == '\0') { + if (inOption) { + if (c == '\0') { ++argv; --argc; inOption = FALSE; @@ -646,12 +646,12 @@ rearg: } /* '-' found at some earlier point */ getopt_spec = strchr(getopt_def, c); - if(c != '\0' && getopt_spec != NULL && getopt_spec[1] == ':') { + if (c != '\0' && getopt_spec != NULL && getopt_spec[1] == ':') { /* - found, and should have an arg */ inOption = FALSE; arginc = 1; argvalue = optscan; - if(*argvalue == '\0') { + if (*argvalue == '\0') { if (argc < 3) goto noarg; argvalue = argv[2]; @@ -662,15 +662,15 @@ rearg: } switch (c) { case '\0': - arginc = 1; - inOption = FALSE; - break; + arginc = 1; + inOption = FALSE; + break; case '-': - dashDash = TRUE; - break; + dashDash = TRUE; + break; default: - if (!MainParseArg(c, argvalue)) - goto noarg; + if (!MainParseArg(c, argvalue)) +goto noarg; } argv += arginc; argc -= arginc;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:20:48 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): extract handling of the -m option into separate function To generate a diff of this commit: cvs rdiff -u -r1.356 -r1.357 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.356 src/usr.bin/make/main.c:1.357 --- src/usr.bin/make/main.c:1.356 Thu Oct 1 23:14:07 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:20:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.356 2020/10/01 23:14:07 rillig Exp $ */ +/* $NetBSD: main.c,v 1.357 2020/10/01 23:20:48 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.356 2020/10/01 23:14:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.357 2020/10/01 23:20:48 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -456,11 +456,27 @@ MainParseArgJobs(const char *argvalue) maxJobTokens = maxJobs; } +static void +MainParseArgSysInc(const char *argvalue) +{ + char found_path[MAXPATHLEN + 1]; + + /* look for magic parent directory search string */ + if (strncmp(".../", argvalue, 4) == 0) { + if (!Dir_FindHereOrAbove(curdir, argvalue + 4, + found_path, sizeof(found_path))) + return; + (void)Dir_AddDir(sysIncPath, found_path); + } else { + (void)Dir_AddDir(sysIncPath, argvalue); + } + Var_Append(MAKEFLAGS, "-m", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); +} + static Boolean MainParseArg(char c, char *argvalue) { - char found_path[MAXPATHLEN + 1];/* for searching for sys.mk */ - switch (c) { case '\0': break; @@ -551,17 +567,7 @@ MainParseArg(char c, char *argvalue) break; case 'm': if (argvalue == NULL) return FALSE; - /* look for magic parent directory search string */ - if (strncmp(".../", argvalue, 4) == 0) { - if (!Dir_FindHereOrAbove(curdir, argvalue + 4, - found_path, sizeof(found_path))) -break; /* nothing doing */ - (void)Dir_AddDir(sysIncPath, found_path); - } else { - (void)Dir_AddDir(sysIncPath, argvalue); - } - Var_Append(MAKEFLAGS, "-m", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + MainParseArgSysInc(argvalue); break; case 'n': noExecute = TRUE;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:14:08 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): extract option handling for -j/-J into separate functions To generate a diff of this commit: cvs rdiff -u -r1.355 -r1.356 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.355 src/usr.bin/make/main.c:1.356 --- src/usr.bin/make/main.c:1.355 Thu Oct 1 23:06:56 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:14:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.355 2020/10/01 23:06:56 rillig Exp $ */ +/* $NetBSD: main.c,v 1.356 2020/10/01 23:14:07 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.355 2020/10/01 23:06:56 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.356 2020/10/01 23:14:07 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -411,10 +411,54 @@ MainParseArgChdir(const char *argvalue) ignorePWD = TRUE; } +static void +MainParseArgJobsInternal(const char *argvalue) +{ + if (sscanf(argvalue, "%d,%d", _0, _1) != 2) { + (void)fprintf(stderr, + "%s: internal error -- J option malformed (%s)\n", + progname, argvalue); + usage(); + } + if ((fcntl(jp_0, F_GETFD, 0) < 0) || + (fcntl(jp_1, F_GETFD, 0) < 0)) { +#if 0 + (void)fprintf(stderr, + "%s: ## warning -- J descriptors were closed!\n", + progname); + exit(2); +#endif + jp_0 = -1; + jp_1 = -1; + compatMake = TRUE; + } else { + Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + } +} + +static void +MainParseArgJobs(const char *argvalue) +{ + char *p; + + forceJobs = TRUE; + maxJobs = strtol(argvalue, , 0); + if (*p != '\0' || maxJobs < 1) { + (void)fprintf(stderr, + "%s: illegal argument to -j -- must be positive integer!\n", + progname); + exit(1); /* XXX: why not 2? */ + } + Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + Var_Set(".MAKE.JOBS", argvalue, VAR_GLOBAL); + maxJobTokens = maxJobs; +} + static Boolean MainParseArg(char c, char *argvalue) { - char *p; char found_path[MAXPATHLEN + 1];/* for searching for sys.mk */ switch (c) { @@ -442,27 +486,7 @@ MainParseArg(char c, char *argvalue) break; case 'J': if (argvalue == NULL) return FALSE; - if (sscanf(argvalue, "%d,%d", _0, _1) != 2) { - (void)fprintf(stderr, - "%s: internal error -- J option malformed (%s)\n", - progname, argvalue); - usage(); - } - if ((fcntl(jp_0, F_GETFD, 0) < 0) || - (fcntl(jp_1, F_GETFD, 0) < 0)) { -#if 0 - (void)fprintf(stderr, - "%s: ## warning -- J descriptors were closed!\n", - progname); - exit(2); -#endif - jp_0 = -1; - jp_1 = -1; - compatMake = TRUE; - } else { - Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - } + MainParseArgJobsInternal(argvalue); break; case 'N': noExecute = TRUE; @@ -519,17 +543,7 @@ MainParseArg(char c, char *argvalue) break; case 'j': if (argvalue == NULL) return FALSE; - forceJobs = TRUE; - maxJobs = strtol(argvalue, , 0); - if (*p != '\0' || maxJobs < 1) { - (void)fprintf(stderr, "%s: illegal argument to -j -- must be positive integer!\n", - progname); - exit(1); - } - Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - Var_Set(".MAKE.JOBS", argvalue, VAR_GLOBAL); - maxJobTokens = maxJobs; + MainParseArgJobs(argvalue); break; case 'k': keepgoing = TRUE;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:06:56 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): extract MainParseArgChdir into separate function This removes the struct stat from MainParseArg. To generate a diff of this commit: cvs rdiff -u -r1.354 -r1.355 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.354 src/usr.bin/make/main.c:1.355 --- src/usr.bin/make/main.c:1.354 Thu Oct 1 23:02:07 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:06:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.354 2020/10/01 23:02:07 rillig Exp $ */ +/* $NetBSD: main.c,v 1.355 2020/10/01 23:06:56 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.354 2020/10/01 23:02:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.355 2020/10/01 23:06:56 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -388,10 +388,32 @@ is_relpath(const char *path) return FALSE; } +static void +MainParseArgChdir(const char *argvalue) +{ + struct stat sa, sb; + + if (chdir(argvalue) == -1) { + (void)fprintf(stderr, "%s: chdir %s: %s\n", + progname, argvalue, strerror(errno)); + exit(1); + } + if (getcwd(curdir, MAXPATHLEN) == NULL) { + (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); + exit(2); + } + if (!is_relpath(argvalue) && + stat(argvalue, ) != -1 && + stat(curdir, ) != -1 && + sa.st_ino == sb.st_ino && + sa.st_dev == sb.st_dev) + strncpy(curdir, argvalue, MAXPATHLEN); + ignorePWD = TRUE; +} + static Boolean MainParseArg(char c, char *argvalue) { - struct stat sa, sb; char *p; char found_path[MAXPATHLEN + 1];/* for searching for sys.mk */ @@ -404,24 +426,7 @@ MainParseArg(char c, char *argvalue) Var_Set(MAKE_MODE, "compat", VAR_GLOBAL); break; case 'C': - if (chdir(argvalue) == -1) { - (void)fprintf(stderr, - "%s: chdir %s: %s\n", - progname, argvalue, - strerror(errno)); - exit(1); - } - if (getcwd(curdir, MAXPATHLEN) == NULL) { - (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); - exit(2); - } - if (!is_relpath(argvalue) && - stat(argvalue, ) != -1 && - stat(curdir, ) != -1 && - sa.st_ino == sb.st_ino && - sa.st_dev == sb.st_dev) - strncpy(curdir, argvalue, MAXPATHLEN); - ignorePWD = TRUE; + MainParseArgChdir(argvalue); break; case 'D': if (argvalue == NULL || argvalue[0] == 0) return FALSE;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 23:02:08 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): extract MainParseArg into separate function That part of the code is long enough and independent enough to get its own function. Having a struct stat in MainParseArgs just didn't feel like a correct abstraction level. To generate a diff of this commit: cvs rdiff -u -r1.353 -r1.354 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.353 src/usr.bin/make/main.c:1.354 --- src/usr.bin/make/main.c:1.353 Thu Oct 1 22:42:00 2020 +++ src/usr.bin/make/main.c Thu Oct 1 23:02:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.353 2020/10/01 22:42:00 rillig Exp $ */ +/* $NetBSD: main.c,v 1.354 2020/10/01 23:02:07 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -126,7 +126,7 @@ #endif /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.353 2020/10/01 22:42:00 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.354 2020/10/01 23:02:07 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ The Regents of the University of California. All rights reserved."); @@ -388,6 +388,194 @@ is_relpath(const char *path) return FALSE; } +static Boolean +MainParseArg(char c, char *argvalue) +{ + struct stat sa, sb; + char *p; + char found_path[MAXPATHLEN + 1];/* for searching for sys.mk */ + + switch (c) { + case '\0': + break; + case 'B': + compatMake = TRUE; + Var_Append(MAKEFLAGS, "-B", VAR_GLOBAL); + Var_Set(MAKE_MODE, "compat", VAR_GLOBAL); + break; + case 'C': + if (chdir(argvalue) == -1) { + (void)fprintf(stderr, + "%s: chdir %s: %s\n", + progname, argvalue, + strerror(errno)); + exit(1); + } + if (getcwd(curdir, MAXPATHLEN) == NULL) { + (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); + exit(2); + } + if (!is_relpath(argvalue) && + stat(argvalue, ) != -1 && + stat(curdir, ) != -1 && + sa.st_ino == sb.st_ino && + sa.st_dev == sb.st_dev) + strncpy(curdir, argvalue, MAXPATHLEN); + ignorePWD = TRUE; + break; + case 'D': + if (argvalue == NULL || argvalue[0] == 0) return FALSE; + Var_Set(argvalue, "1", VAR_GLOBAL); + Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + break; + case 'I': + if (argvalue == NULL) return FALSE; + Parse_AddIncludeDir(argvalue); + Var_Append(MAKEFLAGS, "-I", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + break; + case 'J': + if (argvalue == NULL) return FALSE; + if (sscanf(argvalue, "%d,%d", _0, _1) != 2) { + (void)fprintf(stderr, + "%s: internal error -- J option malformed (%s)\n", + progname, argvalue); + usage(); + } + if ((fcntl(jp_0, F_GETFD, 0) < 0) || + (fcntl(jp_1, F_GETFD, 0) < 0)) { +#if 0 + (void)fprintf(stderr, + "%s: ## warning -- J descriptors were closed!\n", + progname); + exit(2); +#endif + jp_0 = -1; + jp_1 = -1; + compatMake = TRUE; + } else { + Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + } + break; + case 'N': + noExecute = TRUE; + noRecursiveExecute = TRUE; + Var_Append(MAKEFLAGS, "-N", VAR_GLOBAL); + break; + case 'S': + keepgoing = FALSE; + Var_Append(MAKEFLAGS, "-S", VAR_GLOBAL); + break; + case 'T': + if (argvalue == NULL) return FALSE; + tracefile = bmake_strdup(argvalue); + Var_Append(MAKEFLAGS, "-T", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + break; + case 'V': + case 'v': + if (argvalue == NULL) return FALSE; + printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS; + Lst_Append(variables, bmake_strdup(argvalue)); + Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + break; + case 'W': + parseWarnFatal = TRUE; + break; + case 'X': + varNoExportEnv = TRUE; + Var_Append(MAKEFLAGS, "-X", VAR_GLOBAL); + break; + case 'd': + if (argvalue == NULL) return FALSE; + /* If '-d-opts' don't pass to children */ + if (argvalue[0] == '-') + argvalue++; + else { + Var_Append(MAKEFLAGS, "-d", VAR_GLOBAL); + Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); + } + parse_debug_options(argvalue); + break; + case 'e': + checkEnvFirst = TRUE; + Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL); + break; + case 'f': + if (argvalue == NULL) return FALSE; + Lst_Append(makefiles, bmake_strdup(argvalue)); + break; + case 'i': + ignoreErrors = TRUE; + Var_Append(MAKEFLAGS, "-i", VAR_GLOBAL); + break; + case 'j': + if (argvalue == NULL) return FALSE; + forceJobs = TRUE; + maxJobs = strtol(argvalue, , 0); + if (*p != '\0' || maxJobs < 1) { + (void)fprintf(stderr, "%s: illegal argument to -j -- must be positive integer!\n", +
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 22:42:00 UTC 2020 Modified Files: src/usr.bin/make: arch.c compat.c cond.c dir.c job.c main.c make.c make_malloc.c Log Message: make(1): remove redundant function prototypes To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/usr.bin/make/arch.c cvs rdiff -u -r1.160 -r1.161 src/usr.bin/make/compat.c cvs rdiff -u -r1.155 -r1.156 src/usr.bin/make/cond.c cvs rdiff -u -r1.153 -r1.154 src/usr.bin/make/dir.c cvs rdiff -u -r1.253 -r1.254 src/usr.bin/make/job.c cvs rdiff -u -r1.352 -r1.353 src/usr.bin/make/main.c cvs rdiff -u -r1.156 -r1.157 src/usr.bin/make/make.c cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/make_malloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.126 src/usr.bin/make/arch.c:1.127 --- src/usr.bin/make/arch.c:1.126 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/arch.c Thu Oct 1 22:42:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.126 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.127 2020/10/01 22:42:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -134,7 +134,7 @@ #include"config.h" /* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: arch.c,v 1.126 2020/09/28 22:23:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: arch.c,v 1.127 2020/10/01 22:42:00 rillig Exp $"); #ifdef TARGET_MACHINE #undef MAKE_MACHINE @@ -158,7 +158,6 @@ typedef struct Arch { size_t fnamesize; /* Size of the string table */ } Arch; -static struct ar_hdr *ArchStatMember(const char *, const char *, Boolean); static FILE *ArchFindMember(const char *, const char *, struct ar_hdr *, const char *); #if defined(__svr4__) || defined(__SVR4) || defined(__ELF__) Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.160 src/usr.bin/make/compat.c:1.161 --- src/usr.bin/make/compat.c:1.160 Thu Oct 1 21:00:55 2020 +++ src/usr.bin/make/compat.c Thu Oct 1 22:42:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.161 2020/10/01 22:42:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,10 +99,9 @@ #include"pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.161 2020/10/01 22:42:00 rillig Exp $"); static GNode *curTarg = NULL; -static void CompatInterrupt(int); static pid_t compatChild; static int compatSigno; Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.155 src/usr.bin/make/cond.c:1.156 --- src/usr.bin/make/cond.c:1.155 Mon Sep 28 23:13:57 2020 +++ src/usr.bin/make/cond.c Thu Oct 1 22:42:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.156 2020/10/01 22:42:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -93,7 +93,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.156 2020/10/01 22:42:00 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: @@ -151,7 +151,6 @@ typedef struct CondParser { } CondParser; static Token CondParser_Expr(CondParser *par, Boolean); -static CondEvalResult CondParser_Eval(CondParser *par, Boolean *value); static unsigned int cond_depth = 0; /* current .if nesting level */ static unsigned int cond_min_depth = 0; /* depth at makefile open */ Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.153 src/usr.bin/make/dir.c:1.154 --- src/usr.bin/make/dir.c:1.153 Mon Sep 28 23:13:57 2020 +++ src/usr.bin/make/dir.c Thu Oct 1 22:42:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.154 2020/10/01 22:42:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -136,7 +136,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.154 2020/10/01 22:42:00 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -246,13 +246,6 @@ static Hash_Table mtimes; static Hash_Table lmtimes; /* same as mtimes but for lstat */ -static void DirExpandInt(const char *, SearchPath *, StringList *); -static char *DirLookup(CachedDir *, const char *, const char *, Boolean); -static char *DirLookupSubdir(CachedDir *, const char *); -static char *DirFindDot(Boolean, const char *, const char *); -static char *DirLookupAbs(CachedDir *, const char *, const char
CVS commit: src/external/mit/xorg/bin/xeyes
Module Name:src Committed By: nia Date: Thu Oct 1 21:22:47 UTC 2020 Modified Files: src/external/mit/xorg/bin/xeyes: Makefile Log Message: xeyes: Enable anti-aliasing with XRENDER If you prefer the "classic" look, "xeyes +render" To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/xeyes/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/bin/xeyes/Makefile diff -u src/external/mit/xorg/bin/xeyes/Makefile:1.2 src/external/mit/xorg/bin/xeyes/Makefile:1.3 --- src/external/mit/xorg/bin/xeyes/Makefile:1.2 Sun Mar 11 08:21:24 2018 +++ src/external/mit/xorg/bin/xeyes/Makefile Thu Oct 1 21:22:47 2020 @@ -1,11 +1,13 @@ -# $NetBSD: Makefile,v 1.2 2018/03/11 08:21:24 mrg Exp $ +# $NetBSD: Makefile,v 1.3 2020/10/01 21:22:47 nia Exp $ .include +CPPFLAGS+=-DXRENDER + PROG= xeyes SRCS= xeyes.c Eyes.c transform.c -LDADD+= -lXmu -lXt -lSM -lICE -lXext -lX11 -lm +LDADD+= -lXmu -lXt -lSM -lICE -lXext -lXrender -lX11 -lm DPADD+= ${LIBXMU} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11} ${LIBM} .PATH: ${X11SRCDIR.${PROG}}
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Thu Oct 1 21:00:55 UTC 2020 Modified Files: src/usr.bin/make: compat.c Log Message: make(1): add note about "..." with duplicate shell commands To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/usr.bin/make/compat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.159 src/usr.bin/make/compat.c:1.160 --- src/usr.bin/make/compat.c:1.159 Mon Sep 28 23:13:57 2020 +++ src/usr.bin/make/compat.c Thu Oct 1 21:00:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,7 +99,7 @@ #include"pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $"); static GNode *curTarg = NULL; static void CompatInterrupt(int); @@ -207,6 +207,11 @@ Compat_RunCommand(const char *cmdp, stru errCheck = !(gn->type & OP_IGNORE); doIt = FALSE; +/* Luckily the commands don't end up in a string pool, otherwise + * this comparison could match too early, in a dependency using "..." + * for delayed commands, run in parallel mode, using the same shell + * command line more than once; see JobPrintCommand. + * TODO: write a unit-test to protect against this potential bug. */ cmdNode = Lst_FindDatum(gn->commands, cmd); (void)Var_Subst(cmd, gn, VARE_WANTRES, ); /* TODO: handle errors */
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Thu Oct 1 18:34:06 UTC 2020 Modified Files: src/doc: RESPONSIBLE Log Message: Reset the entries for drochner and dsl i386 and amd64 are now maintained by core. To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/doc/RESPONSIBLE Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/RESPONSIBLE diff -u src/doc/RESPONSIBLE:1.125 src/doc/RESPONSIBLE:1.126 --- src/doc/RESPONSIBLE:1.125 Sat Apr 4 16:25:17 2020 +++ src/doc/RESPONSIBLE Thu Oct 1 18:34:06 2020 @@ -1,4 +1,4 @@ -# $NetBSD: RESPONSIBLE,v 1.125 2020/04/04 16:25:17 jdolecek Exp $ +# $NetBSD: RESPONSIBLE,v 1.126 2020/10/01 18:34:06 kamil Exp $ List of sections of the system, and who is responsible for them (or at least considered an expert on them). @@ -60,7 +60,7 @@ ppp(async) christos ppp(sync) martin? racoon manu routed christos -sh christos, dsl, kre +sh christos, kre sort jdolecek sysctl atatat* talk/talkd dholland @@ -263,7 +263,7 @@ Portmasters: [should be synced with src/distrib/notes/common/main] acorn32 reinoud -amd64 dsl +amd64 core algor core alpha matt amiga is @@ -272,7 +272,7 @@ arc soda atari jdc bebox core cats core -cesfic drochner +cesfic core cobalt core emips pooka evbarm core @@ -285,7 +285,7 @@ hpcarm core hpcmips core hpcsh uwe hppa skrll -i386 dsl +i386 core ibmnws matt iyonix gavan landisk uwe @@ -323,7 +323,7 @@ xen bouyer MD Misc: hpcboot uwe -i386 bootblocks dsl, drochner, fvdl*, christos +i386 bootblocks fvdl*, christos amiga pci rkujawa
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Thu Oct 1 18:23:29 UTC 2020 Removed Files: src/doc: TODO.sanitizers Log Message: Remove To generate a diff of this commit: cvs rdiff -u -r1.14 -r0 src/doc/TODO.sanitizers Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Thu Oct 1 18:21:11 UTC 2020 Removed Files: src/doc: TODO.ptrace Log Message: Drop TODO.ptrace The remaining issues are mostly tracked in the ATF ptrace tests and GDB or LLDB test-suite. To generate a diff of this commit: cvs rdiff -u -r1.32 -r0 src/doc/TODO.ptrace Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Thu Oct 1 18:19:20 UTC 2020 Modified Files: src/doc: TODO.sanitizers Log Message: Drop TODO.sanitizers The LLVM work is merged mostly to GCC. The remaining work is not worth tracking here and is restricted mostly to fixing bugs from various 'make check-*' targets in LLVM. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/doc/TODO.sanitizers Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.sanitizers diff -u src/doc/TODO.sanitizers:1.13 src/doc/TODO.sanitizers:1.14 --- src/doc/TODO.sanitizers:1.13 Thu Apr 2 11:18:23 2020 +++ src/doc/TODO.sanitizers Thu Oct 1 18:19:20 2020 @@ -15,9 +15,6 @@ Long term: * DFSan. - port HWASan -- aarch64 specific, needs hardware or emulator - pkgsrc integration with sanitizers and MKSANITIZER (PKGSANITIZER?) - - port what possible to !amd64 - - fixes with the signal code - - make compiler-rt buildable with GCC - merge of the libFuzzer integration with the basesystem - oom-killer ATF tests and fixes - utime(3) allow changing actime regardless of noatime mount property
CVS commit: src
Module Name:src Committed By: nia Date: Thu Oct 1 17:13:19 UTC 2020 Modified Files: src/share/man/man4: pms.4 src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Emulate scrolling when the middle button is held with TrackPoints idea stolen from various other operating systems. this configurable with a sysctl in case somebody wants to hold the middle button, e.g. with old window managers that close menus when a button is released. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/share/man/man4/pms.4 cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pckbport/synaptics.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/pms.4 diff -u src/share/man/man4/pms.4:1.37 src/share/man/man4/pms.4:1.38 --- src/share/man/man4/pms.4:1.37 Mon Mar 16 09:31:41 2020 +++ src/share/man/man4/pms.4 Thu Oct 1 17:13:19 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pms.4,v 1.37 2020/03/16 09:31:41 nia Exp $ +.\" $NetBSD: pms.4,v 1.38 2020/10/01 17:13:19 nia Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd March 14, 2020 +.Dd October 1, 2020 .Dt PMS 4 .Os .Sh NAME @@ -215,6 +215,10 @@ If this variable is set too high then mo as Z-axis events after the two finger scoll has finished. If the variable is set too low then there will be mouse movements observed during the two finger scroll. +.It Dv hw.synaptics.aux_mid_button_scroll +This causes Y-axis movement on the "passthrough device" (e.g. the TrackPoint +on ThinkPads) to result in scrolling events instead of Y-axis movement when +the middle button is held. .El .Pp The following Index: src/sys/dev/pckbport/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.69 src/sys/dev/pckbport/synaptics.c:1.70 --- src/sys/dev/pckbport/synaptics.c:1.69 Thu Oct 1 15:08:11 2020 +++ src/sys/dev/pckbport/synaptics.c Thu Oct 1 17:13:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.70 2020/10/01 17:13:19 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.70 2020/10/01 17:13:19 nia Exp $"); #include #include @@ -124,6 +124,7 @@ static int synaptics_fscroll_min = 13; static int synaptics_fscroll_max = 14; static int synaptics_dz_hold = 30; static int synaptics_movement_enable = 1; +static bool synaptics_aux_mid_button_scroll = TRUE; /* Sysctl nodes. */ static int synaptics_button_boundary_nodenum; @@ -152,6 +153,7 @@ static int synaptics_finger_scroll_min_n static int synaptics_finger_scroll_max_nodenum; static int synaptics_dz_hold_nodenum; static int synaptics_movement_enable_nodenum; +static int synaptics_aux_mid_button_scroll_nodenum; static int synaptics_poll_cmd(struct pms_softc *psc, ...) @@ -830,6 +832,18 @@ pms_sysctl_synaptics(struct sysctllog ** goto err; synaptics_dz_hold_nodenum = node->sysctl_num; + + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_BOOL, "aux_mid_button_scroll", + SYSCTL_DESCR("Interpet Y-Axis movement with the middle button held as scrolling on the passthrough device (e.g. TrackPoint)"), + pms_sysctl_synaptics_verify, 0, + _aux_mid_button_scroll, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + + synaptics_aux_mid_button_scroll_nodenum = node->sysctl_num; return; err: @@ -923,6 +937,10 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG if (t < 0 || t > 1) return (EINVAL); } else + if (node.sysctl_num == synaptics_aux_mid_button_scroll_nodenum) { + if (t < 0 || t > 1) + return (EINVAL); + } else return (EINVAL); *(int *)rnode->sysctl_data = t; @@ -1174,6 +1192,15 @@ pms_synaptics_passthrough(struct pms_sof psc->buttons ^= changed; if (dx || dy || dz || changed) { + /* + * If the middle button is held, interpret Y-axis + * movement as scrolling. + */ + if (synaptics_aux_mid_button_scroll && + dy && (psc->buttons & 0x2)) { + dz = -dy; + dx = dy = 0; + } buttons = (psc->buttons & 0x1f) | ((psc->buttons >> 5) & 0x7); s = spltty(); wsmouse_input(psc->sc_wsmousedev,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Thu Oct 1 15:08:11 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: erect a signpost for weary travellers To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pckbport/synaptics.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pckbport/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.68 src/sys/dev/pckbport/synaptics.c:1.69 --- src/sys/dev/pckbport/synaptics.c:1.68 Thu Oct 1 14:33:26 2020 +++ src/sys/dev/pckbport/synaptics.c Thu Oct 1 15:08:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $"); #include #include @@ -1141,6 +1141,10 @@ pms_synaptics_parse(struct pms_softc *ps pms_synaptics_process_packet(psc, ); } +/* + * Passthrough is used for e.g. TrackPoints and additional pointing + * devices connected to a Synaptics touchpad. + */ static void pms_synaptics_passthrough(struct pms_softc *psc) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Thu Oct 1 14:33:26 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: comment was likely true in 2007 but no longer reflects the reality of hw To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pckbport/synaptics.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pckbport/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.67 src/sys/dev/pckbport/synaptics.c:1.68 --- src/sys/dev/pckbport/synaptics.c:1.67 Thu May 14 18:06:58 2020 +++ src/sys/dev/pckbport/synaptics.c Thu Oct 1 14:33:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $"); #include #include @@ -1683,20 +1683,12 @@ pms_synaptics_process_packet(struct pms_ if (synaptics_up_down_emul == 2) { if (sc->up_down == 0) { if (sp->sp_up && sp->sp_down) { -/* - * Most up/down buttons will be actuated using - * a rocker switch, so we should never see - * them both simultaneously. But just in case, - * treat this situation as a middle button - * event. - */ sp->sp_middle = 1; - } else - if (sp->sp_up) + } else if (sp->sp_up) { dz = -synaptics_up_down_motion_delta; - else - if (sp->sp_down) + } else if (sp->sp_down) { dz = synaptics_up_down_motion_delta; + } } sc->up_down = sp->sp_up | sp->sp_down;
CVS commit: src/tests/net/if_tap
Module Name:src Committed By: rin Date: Thu Oct 1 13:49:18 UTC 2020 Modified Files: src/tests/net/if_tap: Makefile Log Message: Link librumpclient explicitly. Fix sun2, i.e., MKPIC=no build. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/if_tap/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_tap/Makefile diff -u src/tests/net/if_tap/Makefile:1.5 src/tests/net/if_tap/Makefile:1.6 --- src/tests/net/if_tap/Makefile:1.5 Wed Sep 30 17:14:11 2020 +++ src/tests/net/if_tap/Makefile Thu Oct 1 13:49:18 2020 @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.5 2020/09/30 17:14:11 roy Exp $ +# $NetBSD: Makefile,v 1.6 2020/10/01 13:49:18 rin Exp $ # .include PROG= rump_open_tap MAN= # empty -DPADD= ${LIBRUMPRES} -LDADD= -lrumpres +DPADD= ${LIBRUMPRES} ${LIBRUMPCLIENT} +LDADD= -lrumpres -lrumpclient BINDIR.rump_open_tap= ${TESTSDIR} TESTSDIR= ${TESTSBASE}/net/if_tap
CVS commit: src/sys/arch/evbarm/gumstix
Module Name:src Committed By: skrll Date: Thu Oct 1 08:27:20 UTC 2020 Modified Files: src/sys/arch/evbarm/gumstix: gumstix_machdep.c Log Message: Fix evbarmv5 build To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/evbarm/gumstix/gumstix_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/gumstix/gumstix_machdep.c diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.67 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.68 --- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.67 Tue Sep 29 19:58:50 2020 +++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c Thu Oct 1 08:27:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gumstix_machdep.c,v 1.67 2020/09/29 19:58:50 jmcneill Exp $ */ +/* $NetBSD: gumstix_machdep.c,v 1.68 2020/10/01 08:27:20 skrll Exp $ */ /* * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation. * All rights reserved. @@ -152,10 +152,10 @@ #include "arml2cc.h" #endif #include "prcm.h" -#endif #include "arma9tmr.h" #include "armgtmr.h" +#endif #include #include
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Thu Oct 1 07:31:27 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: procfs_machdep.c Log Message: KNF (and some newlines) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/procfs_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/procfs_machdep.c diff -u src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.3 src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.4 --- src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.3 Thu Oct 1 06:40:16 2020 +++ src/sys/arch/aarch64/aarch64/procfs_machdep.c Thu Oct 1 07:31:27 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.3 2020/10/01 06:40:16 ryo Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.4 2020/10/01 07:31:27 skrll Exp $ */ /*- * Copyright (c) 2020 Ryo Shimizu @@ -27,12 +27,14 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.3 2020/10/01 06:40:16 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2020/10/01 07:31:27 skrll Exp $"); #include -#include #include +#include + #include + #include
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: skrll Date: Thu Oct 1 07:21:36 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: mcclock.c Log Message: Fix build To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/alpha/alpha/mcclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/mcclock.c diff -u src/sys/arch/alpha/alpha/mcclock.c:1.20 src/sys/arch/alpha/alpha/mcclock.c:1.21 --- src/sys/arch/alpha/alpha/mcclock.c:1.20 Thu Oct 1 06:59:34 2020 +++ src/sys/arch/alpha/alpha/mcclock.c Thu Oct 1 07:21:36 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mcclock.c,v 1.20 2020/10/01 06:59:34 skrll Exp $ */ +/* $NetBSD: mcclock.c,v 1.21 2020/10/01 07:21:36 skrll Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,12 +29,13 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.20 2020/10/01 06:59:34 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.21 2020/10/01 07:21:36 skrll Exp $"); #include "opt_clock_compat_osf1.h" #include #include +#include #include #include #include
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: skrll Date: Thu Oct 1 06:59:34 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: mcclock.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/alpha/alpha/mcclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/mcclock.c diff -u src/sys/arch/alpha/alpha/mcclock.c:1.19 src/sys/arch/alpha/alpha/mcclock.c:1.20 --- src/sys/arch/alpha/alpha/mcclock.c:1.19 Tue Sep 29 01:20:59 2020 +++ src/sys/arch/alpha/alpha/mcclock.c Thu Oct 1 06:59:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $ */ +/* $NetBSD: mcclock.c,v 1.20 2020/10/01 06:59:34 skrll Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,17 +29,17 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.20 2020/10/01 06:59:34 skrll Exp $"); #include "opt_clock_compat_osf1.h" #include -#include -#include +#include #include +#include #include +#include -#include #include #include
CVS commit: src/sys/arch/aarch64
Module Name:src Committed By: ryo Date: Thu Oct 1 06:40:16 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: procfs_machdep.c src/sys/arch/aarch64/include: cpu.h Log Message: fix build error with LLVM To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/procfs_machdep.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/aarch64/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/procfs_machdep.c diff -u src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.2 src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.3 --- src/sys/arch/aarch64/aarch64/procfs_machdep.c:1.2 Wed Sep 30 08:43:47 2020 +++ src/sys/arch/aarch64/aarch64/procfs_machdep.c Thu Oct 1 06:40:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.2 2020/09/30 08:43:47 ryo Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.3 2020/10/01 06:40:16 ryo Exp $ */ /*- * Copyright (c) 2020 Ryo Shimizu @@ -27,9 +27,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.2 2020/09/30 08:43:47 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.3 2020/10/01 06:40:16 ryo Exp $"); #include +#include +#include #include #include @@ -188,7 +190,7 @@ procfs_getcpuinfstr(char *buf, size_t *l total = 0; for (CPU_INFO_FOREACH(cii, ci)) { - OUTPUT_BUF("processor\t: %lu\n", cii); + OUTPUT_BUF("processor\t: %d\n", cii); len = procfs_cpuinfo_features(ci, buf, left); FORWARD_BUF(len); Index: src/sys/arch/aarch64/include/cpu.h diff -u src/sys/arch/aarch64/include/cpu.h:1.27 src/sys/arch/aarch64/include/cpu.h:1.28 --- src/sys/arch/aarch64/include/cpu.h:1.27 Mon Sep 14 10:06:35 2020 +++ src/sys/arch/aarch64/include/cpu.h Thu Oct 1 06:40:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.27 2020/09/14 10:06:35 ryo Exp $ */ +/* $NetBSD: cpu.h,v 1.28 2020/10/01 06:40:16 ryo Exp $ */ /*- * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc. @@ -156,7 +156,7 @@ void cpu_hatch(struct cpu_info *); extern struct cpu_info *cpu_info[]; extern struct cpu_info cpu_info_store[]; -#define CPU_INFO_ITERATOR cpuid_t +#define CPU_INFO_ITERATOR int #if defined(MULTIPROCESSOR) || defined(_MODULE) #define cpu_number() (curcpu()->ci_index) #define CPU_IS_PRIMARY(ci) ((ci)->ci_index == 0)