File: configure

package info (click to toggle)
ccontrol 0.9.1+20060806-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 440 kB
  • ctags: 188
  • sloc: ansic: 1,478; sh: 302; makefile: 142; python: 141; xml: 64
file content (102 lines) | stat: -rwxr-xr-x 2,551 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#! /bin/sh

reconfigure()
{
    for f in `find . -name '*.in'`; do
	BASE=`echo $f | sed 's/.in$//'`
	sh config.status < $f > $BASE
	chmod --reference=$f $BASE
    done
}

if [ x"$1" = "x--reconfigure" ]; then
    reconfigure
    exit
fi

BINDIR=/usr/local/bin
LIBDIR=/usr/local/lib/ccontrol
MANDIR=/usr/local/share/man
DATADIR=/usr/local/share/ccontrol
XMLTO=`which xmlto`
ASCIIDOC=`which asciidoc`
OPTFLAGS=-O3
VALGRIND=`which valgrind`
VERSION=1.0-pre1
VERSION_NAME="Michael Neuling"
while [ $# -gt 0 ]; do
    case "$1" in
	--bindir=*) BINDIR=`echo $1 | cut -d= -f2-`;;
	--libdir=*) LIBDIR=`echo $1 | cut -d= -f2-`;;
	--mandir=*) MANDIR=`echo $1 | cut -d= -f2-`;;
	--datadir=*) DATADIR=`echo $1 | cut -d= -f2-`;;
	--xmlto=*) XMLTO=`echo $1 | cut -d= -f2-`;;
	--asciidoc=*) ASCIIDOC=`echo $1 | cut -d= -f2-`;;
	--enable-debug) OPTFLAGS=-g; DEBUG=1; NODIET=1;;
	--disable-dietlibc) NODIET=1;;
	--disable-valgrind) VALGRIND="";;
	*)
	    echo "Usage: configure [<options>]" >&2
	    echo "Valid options, with defaults:">&2
	    echo "  --bindir=$BINDIR" >&2
	    echo "  --libdir=$LIBDIR" >&2
	    echo "  --mandir=$MANDIR" >&2
	    echo "  --datadir=$DATADIR" >&2
	    echo "  --xmlto=$XMLTO" >&2
	    echo "  --asciidoc=$ASCIIDOC" >&2
	    echo "  --enable-debug" >&2
	    echo "  --disable-dietlibc" >&2
	    echo "  --disable-valgrind" >&2
	    exit 1
	    ;;
    esac
    shift
done

CC=${CC:-gcc}
if [ -z "$NODIET" ]; then
    echo -n Looking for dietlibc...
    if type diet >/dev/null 2>&1; then
	echo yes
	CC="diet $CC"
    else
	echo no
    fi
fi
echo -n Looking for compiler...
echo $CC

echo -n Looking for compiler flags...
CFLAGS="$OPTFLAGS ${CFLAGS:--Wall -Wmissing-declarations}"
echo $CFLAGS

echo -n Looking for xmlto...
if [ -z "$XMLTO" ]; then
    echo not found '(no regenerating man pages for you)'
    XMLTO="@echo No xmlto found; exit 0; :"
else
    echo $XMLTO
fi

echo -n Looking for asciidoc...
if [ -z "$ASCIIDOC" ]; then
    echo not found '(no regenerating man pages for you)'
    ASCIIDOC="@echo No asciidoc found; exit 0; :"
else
    echo $ASCIIDOC
fi

echo sed -e \""s,@CC@,$CC,g\"" \
	-e \""s,@BINDIR@,$BINDIR,g\"" \
	-e \""s,@LIBDIR@,$LIBDIR,g\"" \
	-e \""s,@MANDIR@,$MANDIR,g\"" \
	-e \""s,@DATADIR@,$DATADIR,g\"" \
	-e \""s,@XMLTO@,$XMLTO,g\"" \
	-e \""s,@ASCIIDOC@,$ASCIIDOC,g\"" \
	-e \""s,@CFLAGS@,$CFLAGS,g\"" \
	-e \""s,@VERSION@,$VERSION,g\"" \
	-e \""s,@VERSION_NAME@,$VERSION_NAME,g\"" \
	-e \""s,@VALGRIND@,$VALGRIND,g\"" > config.status

reconfigure
echo Configuration complete.  Type \"make\" to build.