File: cfg_defs.sh

package info (click to toggle)
lynx 2.9.0dev.6-3~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,516 kB
  • sloc: ansic: 135,095; sh: 3,641; makefile: 1,149; perl: 1,130; yacc: 782
file content (49 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# Translate the lynx_cfg.h and config.cache data into a table, useful for
# display at runtime.

TOP="${1-.}"
OUT=cfg_defs.h

# just in case we want to run this outside the makefile
: ${SHELL:=/bin/sh}

cat >$OUT <<EOF
#ifndef CFG_DEFS_H
#define CFG_DEFS_H 1

static const struct {
	const char *name;
	const char *value;
} config_cache[] = {
EOF

sed \
	-e "s@`pwd`@SUPRRESSED4REPRODUCIBLEBUILD@g" \
	-e '/^#/d'     \
	-e 's/^.[^=]*_cv_//' \
	-e 's/=\${.*=/=/'  \
	-e 's/}$//'          \
	config.cache | $SHELL $TOP/scripts/cfg_edit.sh >>$OUT

cat >>$OUT <<EOF
};

static const struct {
	const char *name;
	const char *value;
} config_defines[] = {
EOF
fgrep	'#define' lynx_cfg.h |
sed	-e 's@	@ @g' \
	-e 's@  @ @g' \
	-e 's@^[ 	]*#define[ 	]*@@' \
	-e 's@[ ]*/\*.*\*/@@' \
	-e 's@[ 	][ 	]*@=@' \
    | $SHELL $TOP/scripts/cfg_edit.sh >>$OUT

cat >>$OUT <<EOF
};

#endif /* CFG_DEFS_H */
EOF