Welcome to mirror list, hosted at ThFree Co, Russian Federation.

configure.cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c4d08e30cdf28592270a6c60b073bde137eb862 (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
46
47
48
49
addto_CPPFLAGS() {
    local f
    for f; do
	case " $CPPFLAGS " in
	    *\ $f\ *) ;;
	    *) CPPFLAGS="$CPPFLAGS $f" ;;
	esac
    done
}

realdirpath() {
    [ -z "$1" ] && return 1
    (cd "$1" 2>/dev/null && pwd)
    if test $? -ne 0; then
	return 1
    else
	return 0
    fi
}

for d in . .. ../.. ../../..; do
    if test -e "$srcdir/$d/configure.cygwin"; then
	winsup_srcdir=$(realdirpath "$srcdir/$d")
	break
    fi
done

if test -z "$winsup_srcdir"; then
    echo "cannot find directory containing configure.cygwin" 1>&2
    exit 1
fi

case "$srcdir" in
    */newlib*)	lookfor=newlib ;;
    */winsup*)	lookfor=winsup ;;
    *)		lookfor=. ;;
esac

for d in . .. ../.. ../../..; do
    if test -d "$d/$lookfor"; then
	target_builddir=$(realdirpath "$d")
	break
    fi
done

if test -z "$target_builddir"; then
    echo "cannot determine top build dir, looking for $lookfor" 1>&2
    exit 1
fi