diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1998-09-13 14:41:19 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1998-09-13 14:41:19 -0400 |
commit | 02f2851492143446abaaa33cc9536fade7b51124 (patch) | |
tree | 613e06824c47ca1592dd53eab57ed1ddb1409404 /cfg_defs.sh | |
parent | 5816641fc3a761e00d154c4dea9551a0027a7c63 (diff) | |
download | lynx-snapshots-02f2851492143446abaaa33cc9536fade7b51124.tar.gz |
snapshot of project "lynx", label v2-8-1dev_26
Diffstat (limited to 'cfg_defs.sh')
-rwxr-xr-x | cfg_defs.sh | 45 |
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 |