about summary refs log tree commit diff
path: root/configure
blob: a805827872eb69d8608561a7fd86ed5fac036dbf (plain)
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
#!/bin/sh

usage()
{
    echo "Use environment variables to pass values:
    CC         - compiler (default: cc)
    CFLAGS     - flags for compiler
    LDFLAGS    - flags for linker
    DESTDIR    - path to make install (default: /usr/local)"
    exit 1
}

while test $# -gt 0; do
    case "$1" in
        -h) usage
            ;;
        --help) usage
            ;;
    esac
    shift
done

CC=${CC:-cc}
CFLAGS=${CFLAGS:-}
LDFLAGS=${LDFLAGS:-}
DESTDIR=${DESTDIR:-/usr/local}

echo "Configuration:
    Compiler: $CC
    CFLAGS: $CFLAGS
    LDFLAGS: $LDFLAGS
    DESTDIR: $DESTDIR"

echo "
#ifndef __CONFIG_H__
#define __CONFIG_H__

#define SHAREDIR \"$DESTDIR/share/cpetpet\"

#endif
" > config.h

echo "
DESTDIR=$DESTDIR
" > config.mk