4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 1995 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
32 #include <mksh/misc.h> /* getmem() */
35 * This file deals with "Dependency Variables".
36 * The "-V var" command line option is used to indicate
37 * that var is a dependency variable. Used in conjunction with
38 * the -P option the user is asking if the named variables affect
39 * the dependencies of the given target.
43 Name name
; /* Name of variable */
44 struct _Depvar
*next
; /* Linked list */
45 Boolean cmdline
; /* Macro defined on the cmdline? */
48 typedef struct _Depvar
*Depvar
;
50 static Depvar depvar_list
;
51 static Depvar
*bpatch
= &depvar_list
;
52 static Boolean variant_deps
;
55 * Add a name to the list.
59 depvar_add_to_list(Name name
, Boolean cmdline
)
66 dv
->cmdline
= cmdline
;
72 * The macro `name' has been used in either the left-hand or
73 * right-hand side of a dependency. See if it is in the
74 * list. Two things are looked for. Names given as args
75 * to the -V list are checked so as to set the same/differ
76 * output for the -P option. Names given as macro=value
77 * command-line args are checked and, if found, an NSE
78 * warning is produced.
81 depvar_dep_macro_used(Name name
)
85 for (dv
= depvar_list
; dv
!= NULL
; dv
= dv
->next
) {
86 if (name
== dv
->name
) {
95 * Print the results. If any of the Dependency Variables
96 * affected the dependencies then the dependencies potentially
97 * differ because of these variables.
100 depvar_print_results(void)
103 printf(gettext("differ\n"));
105 printf(gettext("same\n"));