about summary refs log tree commit diff stats
path: root/cfg_defs.sh
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-09-13 14:41:19 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-09-13 14:41:19 -0400
commit02f2851492143446abaaa33cc9536fade7b51124 (patch)
tree613e06824c47ca1592dd53eab57ed1ddb1409404 /cfg_defs.sh
parent5816641fc3a761e00d154c4dea9551a0027a7c63 (diff)
downloadlynx-snapshots-02f2851492143446abaaa33cc9536fade7b51124.tar.gz
snapshot of project "lynx", label v2-8-1dev_26
Diffstat (limited to 'cfg_defs.sh')
-rwxr-xr-xcfg_defs.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/cfg_defs.sh b/cfg_defs.sh
new file mode 100755
index 00000000..8cffb2e0
--- /dev/null
+++ b/cfg_defs.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Translate the lynx_cfg.h and config.cache data into a table, useful for
+# display at runtime.
+
+cat <<EOF
+#ifndef CFG_DEFS_H
+#define CFG_DEFS_H 1
+
+static CONST struct {
+	CONST char *name;
+	CONST char *value;
+} config_cache[] = {
+EOF
+sed	-e '/^#/d' \
+	-e 's/"/\\"/g' \
+	-e "s/'/\"/g" \
+	-e 's/^.[^=]*_cv_/	{ "/' \
+	-e 's/=${[^=]*="/", "/' \
+	-e 's/=${[^=]*=/", "/' \
+	-e 's/"}$/}/' \
+	-e 's/}$/" },/' \
+	config.cache | sort
+cat <<EOF
+};
+
+static CONST struct {
+	CONST char *name;
+	CONST char *value;
+} config_defines[] = {
+EOF
+fgrep	'#define' lynx_cfg.h |sort |
+sed	-e 's@	@ @g' \
+	-e 's@  @ @g' \
+	-e 's@[ ]*#define @@' \
+	-e 's@[ ]*/\*.*\*/@@' \
+	-e 's@"$@@' \
+	-e 's@"@@' \
+	-e 's@ @", "@' \
+	-e 's@^@	{ "@' \
+	-e 's@$@" },@'
+cat <<EOF
+};
+
+#endif /* CFG_DEFS_H */
+EOF