aboutsummaryrefslogtreecommitdiff
path: root/posix/Makefile
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-12-29 17:37:54 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-12-29 17:37:54 +0530
commit4a6aca7bf8a70f1dc66a07c04aba2d7fd837602d (patch)
tree6f85eb5f9cba191e17cfb74c83d12c19b44a6a7a /posix/Makefile
parent0025b4cc84a0c1099b11a662acabce2709121be5 (diff)
downloadglibc-4a6aca7bf8a70f1dc66a07c04aba2d7fd837602d.zip
glibc-4a6aca7bf8a70f1dc66a07c04aba2d7fd837602d.tar.gz
glibc-4a6aca7bf8a70f1dc66a07c04aba2d7fd837602d.tar.bz2
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.
Diffstat (limited to 'posix/Makefile')
-rw-r--r--posix/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/posix/Makefile b/posix/Makefile
index faefaf1..fe332df 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -99,7 +99,7 @@ others := getconf
install-bin := getconf
install-others-programs := $(inst_libexecdir)/getconf
-before-compile += testcases.h ptestcases.h
+before-compile += testcases.h ptestcases.h posix-conf-vars-def.h
# So they get cleaned up.
generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
@@ -325,3 +325,9 @@ $(objpfx)getconf.speclist: getconf-speclist.c posix-envs.def
# be built both makes it available for eyeball inspection and avoids the
# surprise of things that look like compilation being done by 'make install'.
others: $(objpfx)getconf.speclist
+
+$(objpfx)posix-conf-vars-def.h: $(..)scripts/gen-posix-conf-vars.awk \
+ posix-conf-vars.list Makefile
+ $(make-target-directory)
+ $(AWK) -f $(filter-out Makefile, $^) > $@.tmp
+ mv -f $@.tmp $@