summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile15
-rw-r--r--posix/getconf.speclist.h39
2 files changed, 43 insertions, 11 deletions
diff --git a/posix/Makefile b/posix/Makefile
index 8d8fbe5234..3c3ccfad55 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -301,15 +301,8 @@ $(inst_libexecdir)/getconf: $(inst_bindir)/getconf \
mv -f $@/$$spec.new $@/$$spec; \
done < $(objpfx)getconf.speclist
-$(objpfx)getconf.speclist: $(objpfx)getconf
-ifeq (no,$(cross-compiling))
- LC_ALL=C GETCONF_DIR=/dev/null \
- $(run-program-prefix) $< _POSIX_V7_WIDTH_RESTRICTED_ENVS > $@.new
- LC_ALL=C GETCONF_DIR=/dev/null \
- $(run-program-prefix) $< _POSIX_V6_WIDTH_RESTRICTED_ENVS >> $@.new
- LC_ALL=C GETCONF_DIR=/dev/null \
- $(run-program-prefix) $< _XBS5_WIDTH_RESTRICTED_ENVS >> $@.new
-else
- > $@.new
-endif
+$(objpfx)getconf.speclist: getconf.speclist.h
+ $(CC) -E $(CFLAGS) $(CPPFLAGS) $< \
+ | sed -n -e '/START_OF_STRINGS/,$${/\(POSIX_V[67]\|_XBS5\)_/{s/^[^"]*"//;s/".*$$//;p}}' \
+ > $@.new
mv -f $@.new $@
diff --git a/posix/getconf.speclist.h b/posix/getconf.speclist.h
new file mode 100644
index 0000000000..ebe8cf0df3
--- /dev/null
+++ b/posix/getconf.speclist.h
@@ -0,0 +1,39 @@
+#include <unistd.h>
+const char *START_OF_STRINGS =
+#if _POSIX_V7_ILP32_OFF32 == 1
+"POSIX_V7_ILP32_OFF32"
+#endif
+#if _POSIX_V7_ILP32_OFFBIG == 1
+"POSIX_V7_ILP32_OFFBIG"
+#endif
+#if _POSIX_V7_LP64_OFF64 == 1
+"POSIX_V7_LP64_OFF64"
+#endif
+#if _POSIX_V7_LPBIG_OFFBIG == 1
+"POSIX_V7_LPBIG_OFFBIG"
+#endif
+#if _POSIX_V6_ILP32_OFF32 == 1
+"POSIX_V6_ILP32_OFF32"
+#endif
+#if _POSIX_V6_ILP32_OFFBIG == 1
+"POSIX_V6_ILP32_OFFBIG"
+#endif
+#if _POSIX_V6_LP64_OFF64 == 1
+"POSIX_V6_LP64_OFF64"
+#endif
+#if _POSIX_V6_LPBIG_OFFBIG == 1
+"POSIX_V6_LPBIG_OFFBIG"
+#endif
+#if _XBS5_ILP32_OFF32 == 1
+"XBS5_ILP32_OFF32"
+#endif
+#if _XBS5_ILP32_OFFBIG == 1
+"XBS5_ILP32_OFFBIG"
+#endif
+#if _XBS5_LP64_OFF64 == 1
+"XBS5_LP64_OFF64"
+#endif
+#if _XBS5_LPBIG_OFFBIG == 1
+"XBS5_LPBIG_OFFBIG"
+#endif
+"";