Print this page
make: unifdef for NSE (undefined)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/bin/depvar.cc
+++ new/usr/src/cmd/make/bin/depvar.cc
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 1995 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 /*
27 27 * Included files
28 28 */
29 29 #include <mk/defs.h>
30 30 #include <mksh/misc.h> /* getmem() */
31 31
32 32 /*
33 33 * This file deals with "Dependency Variables".
34 34 * The "-V var" command line option is used to indicate
35 35 * that var is a dependency variable. Used in conjunction with
36 36 * the -P option the user is asking if the named variables affect
37 37 * the dependencies of the given target.
38 38 */
39 39
40 40 struct _Depvar {
41 41 Name name; /* Name of variable */
42 42 struct _Depvar *next; /* Linked list */
43 43 Boolean cmdline; /* Macro defined on the cmdline? */
44 44 };
45 45
46 46 typedef struct _Depvar *Depvar;
47 47
48 48 static Depvar depvar_list;
49 49 static Depvar *bpatch = &depvar_list;
50 50 static Boolean variant_deps;
51 51
52 52 /*
53 53 * Add a name to the list.
54 54 */
55 55
56 56 void
57 57 depvar_add_to_list(Name name, Boolean cmdline)
58 58 {
59 59 Depvar dv;
60 60
61 61 dv = ALLOC(Depvar);
62 62 dv->name = name;
63 63 dv->next = NULL;
64 64 dv->cmdline = cmdline;
65 65 *bpatch = dv;
66 66 bpatch = &dv->next;
67 67 }
68 68
69 69 /*
70 70 * The macro `name' has been used in either the left-hand or
71 71 * right-hand side of a dependency. See if it is in the
72 72 * list. Two things are looked for. Names given as args
73 73 * to the -V list are checked so as to set the same/differ
74 74 * output for the -P option. Names given as macro=value
↓ open down ↓ |
74 lines elided |
↑ open up ↑ |
75 75 * command-line args are checked and, if found, an NSE
76 76 * warning is produced.
77 77 */
78 78 void
79 79 depvar_dep_macro_used(Name name)
80 80 {
81 81 Depvar dv;
82 82
83 83 for (dv = depvar_list; dv != NULL; dv = dv->next) {
84 84 if (name == dv->name) {
85 -#ifdef NSE
86 - if (dv->cmdline) {
87 - nse_dep_cmdmacro(dv->name->string);
88 - }
89 -#endif
90 85 variant_deps = true;
91 86 break;
92 87 }
93 88 }
94 89 }
95 90
96 -#ifdef NSE
97 -/*
98 - * The macro `name' has been used in either the argument
99 - * to a cd before a recursive make. See if it was
100 - * defined on the command-line and, if so, complain.
101 - */
102 -void
103 -depvar_rule_macro_used(Name name)
104 -{
105 - Depvar dv;
106 -
107 - for (dv = depvar_list; dv != NULL; dv = dv->next) {
108 - if (name == dv->name) {
109 - if (dv->cmdline) {
110 - nse_rule_cmdmacro(dv->name->string);
111 - }
112 - break;
113 - }
114 - }
115 -}
116 -#endif
117 91
118 92 /*
119 93 * Print the results. If any of the Dependency Variables
120 94 * affected the dependencies then the dependencies potentially
121 95 * differ because of these variables.
122 96 */
123 97 void
124 98 depvar_print_results(void)
125 99 {
126 100 if (variant_deps) {
127 101 printf(catgets(catd, 1, 234, "differ\n"));
128 102 } else {
129 103 printf(catgets(catd, 1, 235, "same\n"));
130 104 }
131 105 }
132 106
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX