mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Use one-dimension arrays in gen-posix-conf-vars.awk
True multi-dimensional arrays were introduced in awk 4.0 and we support awk versions as early as 3.12. Use a single subscript of the form prefix_conf instead of two dimensions to work around this limitation. We also need one additional array of just the conf names subscripted by the prefix_conf to print the names for the specifications. * scripts/gen-posix-conf-vars.awk: Don't use multi-dimensional arrays.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2014-12-31 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||||
|
|
||||||
|
* scripts/gen-posix-conf-vars.awk: Don't use multi-dimensional
|
||||||
|
arrays.
|
||||||
|
|
||||||
2014-12-30 H.J. Lu <hongjiu.lu@intel.com>
|
2014-12-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
[BZ #17775]
|
[BZ #17775]
|
||||||
|
@ -42,36 +42,36 @@ $1 == "}" {
|
|||||||
# CONFSTR: A configuration string
|
# CONFSTR: A configuration string
|
||||||
# SYSCONF: A numeric value
|
# SYSCONF: A numeric value
|
||||||
# SPEC: A specification
|
# SPEC: A specification
|
||||||
sc_prefixes[prefix][$1] = sc_prefix
|
c = prefix "_" $1
|
||||||
conf[prefix][$1] = type
|
sc_prefixes[c] = sc_prefix
|
||||||
|
prefix_conf[c] = type
|
||||||
|
conf[c] = $1
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
print "/* AUTOGENERATED by gen-posix-conf-vars.awk. DO NOT EDIT. */\n"
|
print "/* AUTOGENERATED by gen-posix-conf-vars.awk. DO NOT EDIT. */\n"
|
||||||
|
|
||||||
# Generate macros that specify if a sysconf macro is defined and/or set.
|
# Generate macros that specify if a sysconf macro is defined and/or set.
|
||||||
for (p in conf) {
|
for (c in prefix_conf) {
|
||||||
for (c in conf[p]) {
|
printf "#ifndef _%s\n", c
|
||||||
printf "#ifndef _%s_%s\n", p, c
|
printf "# define CONF_DEF_%s CONF_DEF_UNDEFINED\n", c
|
||||||
printf "# define CONF_DEF_%s_%s CONF_DEF_UNDEFINED\n", p, c
|
# CONFSTR have string values and they are not set or unset.
|
||||||
# CONFSTR have string values and they are not set or unset.
|
if (prefix_conf[c] != "CONFSTR") {
|
||||||
if (conf[p][c] != "CONFSTR") {
|
printf "#else\n"
|
||||||
printf "#else\n"
|
printf "# if _%s > 0\n", c
|
||||||
printf "# if _%s_%s > 0\n", p, c
|
printf "# define CONF_DEF_%s CONF_DEF_DEFINED_SET\n", c
|
||||||
printf "# define CONF_DEF_%s_%s CONF_DEF_DEFINED_SET\n", p, c
|
printf "# else\n"
|
||||||
printf "# else\n"
|
printf "# define CONF_DEF_%s CONF_DEF_DEFINED_UNSET\n", c
|
||||||
printf "# define CONF_DEF_%s_%s CONF_DEF_DEFINED_UNSET\n", p, c
|
printf "# endif\n"
|
||||||
printf "# endif\n"
|
}
|
||||||
}
|
printf "#endif\n\n"
|
||||||
printf "#endif\n\n"
|
|
||||||
|
|
||||||
# Build a name -> sysconf number associative array to print a C array at
|
# Build a name -> sysconf number associative array to print a C array at
|
||||||
# the end.
|
# the end.
|
||||||
if (conf[p][c] == "SPEC") {
|
if (prefix_conf[c] == "SPEC") {
|
||||||
name = sprintf ("%s_%s", p, c)
|
name = sprintf ("%s", c)
|
||||||
num = sprintf ("%s_%s", sc_prefixes[p][c], c)
|
num = sprintf ("%s_%s", sc_prefixes[c], conf[c])
|
||||||
spec[name] = num
|
spec[name] = num
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user