File: checkconf

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (52 lines) | stat: -rwxr-xr-x 1,038 bytes parent folder | download | duplicates (2)
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
50
51
52
#!/bin/sh
#
# Check build variables set by configure.
#
# Returns true if <variable> is set "true" in src/include/builddefs
#
# Note:
#	this script is ONLY run from the debian/rules makefile, and
#	then the current directory is not . but the base of the
#	build tree, so builddefs is in src/include, not ../src/include
#	as you might expect given the location of this script in the
#	source tree
#

verbose=false
if [ $# -gt 1 -a "X$1" = X-v ]
then
    verbose=true
    shift
fi

if [ $# -ne 1 ]
then
    echo >&2 "Usage: checkconf [-v] <variable>"
    exit 1
fi

if [ -f src/include/builddefs ]
then
    value=`sed -n -e "/^$1[ 	]*=[ 	]*/s///p" src/include/builddefs`
    if [ -z "$value" ]
    then
	$verbose && echo >&2 "$1 not found in builddefs"
	exit 1
    fi
    $verbose && echo >&2 "$1: value=\"$value\""
    if [ "$value" = true ]
    then
	exit 0
    else
	exit 1
    fi
else
    if $verbose
    then
	echo >&2 "src/include/builddefs: not found"
	echo >&2 "pwd: `pwd`"
	ls -l >&2 "src/include/builddefs*"
    fi
    exit 1
fi