From 9052b52dfc69d9567e2e664b0f096bfae535bcad Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 10 May 2002 03:15:07 +0000 Subject: Fix Debian bug #144306: pass target-specific variables into the environment properly. Fix configure: allow cross-compilation; fix getloadavg (still needs _lots_ of work!) Let $(call ...) functions to be self-referencing. Lets us do transitive closures, for example. --- variable.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'variable.h') diff --git a/variable.h b/variable.h index 9c23511..8d4853f 100644 --- a/variable.h +++ b/variable.h @@ -35,19 +35,28 @@ enum variable_origin Each bucket of the hash table is a chain of these, chained through `next'. */ +#define EXP_COUNT_BITS 15 /* This gets all the bitfields into 32 bits */ + +#define EXP_COUNT_MAX ((1<1, allow this many self-referential + expansions */ unsigned int per_target:1; /* Nonzero if a target-specific variable. */ unsigned int append:1; /* Nonzero if an appending target-specific variable. */ + + enum variable_origin + origin ENUM_BITFIELD (3); /* Variable origin. */ + enum variable_export { v_export, /* Export this variable. */ @@ -95,7 +104,9 @@ extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char * char *pattern_percent, char *replace_percent)); /* expand.c */ -extern char *recursively_expand PARAMS ((struct variable *v)); +extern char *recursively_expand_for_file PARAMS ((struct variable *v, + struct file *file)); +#define recursively_expand(v) recursively_expand_for_file (v, NULL) /* variable.c */ extern struct variable_set_list *create_new_variable_set PARAMS ((void)); @@ -135,6 +146,15 @@ extern struct variable *define_variable_in_set #define define_variable_for_file(n,l,v,o,r,f) \ define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) +/* Warn that NAME is an undefined variable. */ + +#define warn_undefined(n,l) do{\ + if (warn_undefined_variables_flag) \ + error (reading_file, \ + _("warning: undefined variable `%.*s'"), \ + (int)(l), (n)); \ + }while(0) + extern char **target_environment PARAMS ((struct file *file)); extern int export_all_variables; -- cgit v1.2.3