summaryrefslogtreecommitdiff
path: root/package/build.linux
blob: d43568dbba04850371fa7fb1b37825e406d5fad6 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh -xe
# check build environment
prepare()
{
	if [ "$JAVA_HOME" = "" ]
	then
		echo "Make sure that you have installed JDK"
		echo "and then set installed JDK/bin path into JAVA_HOME"
		echo "as a system environment variable on your PC!!"
		exit 1
	fi

	if [ "${TARGET_OS}" = "windows-32" ] || [ "${TARGET_OS}" = "windows-64" ]
	then
		# for Windows target (cross compiling)

		# we should use cross compiler from mingw-x package
		export PATH=/opt/mingw32/bin:$PATH
		export CROSS_PREFIX=i686-w64-mingw32-

		# correct pc's prefix since windows install script is not run
		# on linux
		PCs=$(find ${ROOTDIR}/lib/pkgconfig -name '*.pc')

		for pc in ${PCs}; do
			echo "${pc}"
			LIB_DIR=${ROOTDIR}
			sed -i '/LIBDIR=/d' ${pc}
			sed -i '/^prefix=/!b;c\prefix=${LIBDIR}' ${pc}
			sed -i "1s|^|LIBDIR=${LIB_DIR}\n|" ${pc}
		done

		# mingw-x doesn't have zlib, so we use our own.
		export EXTRA_CFLAGS=-I${ROOTDIR}/include
		export EXTRA_LDFLAGS=-L${ROOTDIR}/lib
	else
		# for linux target

		REQUIRED_PKG="ant python zlib1g-dev libglib2.0-dev libsdl1.2-dev \
			libasound2-dev libx11-dev libv4l-dev libxcomposite-dev \
			libpixman-1-dev libcurl4-gnutls-dev	libcap-dev libattr1-dev"

		echo "Checking required packages before compling!!"
		for pkg in ${REQUIRED_PKG}
		do
			dpkg -s ${pkg} > /dev/null
			if [ "x$?" = "x0" ]
			then
				echo "checking ${pkg} ... OK"
			else
				echo "checking ${pkg} ... failure"
				exit 1
			fi
		done
	fi
}

# clean
clean()
{
	echo "nothing to do"
}

# build
build()
{
	. $SRCDIR/package/build.common
	build_common
}

# install
install()
{
	. $SRCDIR/package/build.common
	install_common
}

[ "$1" = "clean" ] && clean
[ "$1" = "build" ] && build
[ "$1" = "install" ] && install

echo "success"