1 # option-groups.awk --- generate option group header file
2 # Given input files containing makefile-style assignments to variables,
3 # print out a header file that #defines an appropriate preprocessor
4 # symbol for each variable left set to 'y'.
9 { gsub (/[[:blank:]]/, "") }
14 # Process assignments.
21 print "/* This file is automatically generated by scripts/option-groups.awk"
22 print " in the EGLIBC source tree."
24 print " It defines macros that indicate which EGLIBC option groups were"
25 print " configured in 'option-groups.config' when this C library was"
26 print " built. For each option group named OPTION_foo, it #defines"
27 print " __OPTION_foo to be 1 if the group is enabled, or leaves that"
28 print " symbol undefined if the group is disabled. */"
30 print "#ifndef __GNU_OPTION_GROUPS_H"
31 print "#define __GNU_OPTION_GROUPS_H"
34 # Produce a sorted list of variable names.
40 for (i = 1; i <= n; i++)
46 print "#define __" var " 1"
47 else if (vars[var] == "n")
48 print "/* #undef __" var " */"
49 # Ignore variables that don't have boolean values.
50 # Ideally, this would be driven by the types given in
56 print "#endif /* __GNU_OPTION_GROUPS_H */"