Commit Graph

3 Commits

Author SHA1 Message Date
Siddhesh Poyarekar 50cbbaa935 Use posix-conf-vars.list to generate spec array
This patch adds support to generate the spec array in getconf from the
conf.list.  The generated code is mostly unchanged.  the only changes
are due to the change in layout of the spec and val arrays in the ELF.

The val array can also be auto-generated from posix-conf-vars.list
once the remaining macros are added to it.

	* posix/posix-conf-vars.list (SPEC:XBS5): Add sysconf prefix.
	* posix/confstr.c: Define NEED_SPEC_ARRAY to 0.
	* posix/posix-envs.def: Likewise.
	* sysdeps/posix/sysconf.c: Likewise.
	* posix/getconf.c: Define NEED_SPEC_ARRAY to 1.
	(specs): Remove array.
	* scripts/gen-posix-conf-vars.awk: Support generation of specs
	array.
2014-12-29 19:56:27 +05:30
Siddhesh Poyarekar 3b566046c3 Add _POSIX namespace SYSCONF macros to posix-conf-vars.list
This fixes the remaining -Wundef warnings.  Tested on x86_64.

	* posix/posix-conf-vars.list: Add _POSIX sysconf namespace.
	* sysdeps/posix/sysconf.c: Include posix-conf-vars.h.
	(__sysconf): Use CONF_IS_* macros.
2014-12-29 19:56:01 +05:30
Siddhesh Poyarekar 4a6aca7bf8 Remove Wundef warnings for specification macros
This patch adds a file posix-conf-vars.list that is used to generate
macros to determine if a macro is defined as set, unset or not
defined.  gen-posix-conf-vars.awk processes this file and generates a
header (posix-conf-vars-def.h) with these macros.  A new header
posix-conf-vars.h includes this generated header and defines accessor
macros for the generated macros.

Tested on x86_64.

	* posix/Makefile (before-compile): Add posix-conf-vars-def.h.
	($(objpfx)posix-conf-vars-def.h): New target.
	* posix/posix-conf-vars.list: New file.
	* posix/posix-conf-vars.h: New file.
	* posix/confstr.c: Include posix-conf-vars.h.
	(confstr): Use CONF_IS_* macros.
	* posix/posix-envs.def: Include posix-conf-vars.h.  Use
	CONF_IS_* macros.
	* scripts/gen-posix-conf-vars.awk: New file.
2014-12-29 17:37:54 +05:30