File: cmake

package info (click to toggle)
xvt 2.1-7
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 272 kB
  • ctags: 429
  • sloc: ansic: 5,116; makefile: 113; sh: 43
file content (39 lines) | stat: -rwxr-xr-x 606 bytes parent folder | download | duplicates (8)
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
#!/bin/sh
#
# Script used to configure the xvt makefile.  Run as cmake FOO BAR it will
#
#	uncomment all lines containing #FOO followed by BAR on the same line
#
#	comment out all lines containing #FOO not followed by BAR
#
#	leave all other lines unchanged
#
if test $# -eq 1
then
	arg="none"
elif test $# -eq 2
then
	arg=$2
else
	echo "usage is cmake arg1 [ arg2 ]" >&2
	exit 1
fi
awk '
/#'$1'.*'$arg'/	{
		if ($0 ~ /^#/)
			printf("%s\n",substr($0,2));
		else
			printf("%s\n",$0);
		next;
	}
/#'$1'/ {
		if ($0 ~ /^#/)
			printf("%s\n",$0);
		else
			printf("#%s\n",$0);
		next;
	}
	{
		print $0;
	}
'