aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/std/bind.conf
blob: 65ee123ab953baea2d88dac9b2a796bc67d0ec61 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
BIND_OPTS=$BIND_OPTS' cc optimize cflags arch'
OPTIMIZE=''
CFLAGS=''

if test -z "$CONFIG_CC" ; then

	echo -n "Analyzing C Compiler..."

	if test -z "$CONFIG_ARCH" ; then
		CONFIG_ARCH=`uname -m`"-"`uname`
	fi

	if fn_find_fpath -x gcc $PATH ; then
		CONFIG_CC='gcc'
		echo "gcc"
	else
		if test -z "$CONFIG_CC" ; then
			CONFIG_CC='cc'
			echo 'cc'
		fi
	fi
fi

opt_optimize() {
	OPTIMIZE="$1"
	CONFIG_COPT="$1"
	return 0
}

opt_cflags() {
	CONFIG_ENDIAN=""
	CONFIG_CFLAGS="$1"
	CFLAGS="$1"
}

opt_cc() {
	CONFIG_CC="$1"
	CONFIG_COPT="$OPTIMIZE"
	CONFIG_CFLAGS="$CFLAGS"
	return 0
}

opt_arch() {
	CONFIG_ENDIAN=""
	CONFIG_ARCH="$1"
	if test "gcc" = $CONFIG_CC ; then
		CONFIG_COPT="$OPTIMIZE"
		if test -d /usr/local/lib/gcc-lib ; then
			GCC_LIB='/usr/local/lib/gcc-lib'
		fi
		if test -d /usr/lib/gcc-lib ; then
			GCC_LIB='/usr/lib/gcc-lib'
		fi
		if fn_find_fpath -d "$1" "$GCC_LIB"':/usr:/usr/local' ; then
			CONFIG_CFLAGS='-b '"$1"
		else
			echo "config: $1: unsupported gcc architecture"
			exit -1
		fi
		if -d /usr/$1/include ; then
			CONFIG_HOST=/usr/$1
		fi
		if -d /usr/local/$1/include ; then
			CONFIG_HOST=/usr/local/$1
		fi
	fi
	return 0
}