10
10
# more details.
11
11
#
12
12
# You should have received a copy of the GNU Lesser General Public License along with
13
- # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St
13
+ # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St
14
14
# - Fifth Floor, Boston, MA 02110-1301 USA
15
15
16
16
if [ ! -d $PWD /install ]; then
17
17
echo " Please source this script from the top level directory of the clutter-android project"
18
18
exit 1
19
19
fi
20
20
21
+ pathadd () {
22
+ if [ -d " $1 " ] && [[ " :$PATH :" != * " :$1 :" * ]]; then
23
+ export PATH=" ${PATH: +" $PATH :" } $1 "
24
+ fi
25
+ }
21
26
22
27
SOURCES=" $PWD /sources"
23
28
PREFIX=" $PWD /install"
@@ -30,9 +35,9 @@ export CXX=arm-linux-androideabi-g++
30
35
export C_INCLUDE_PATH=$PREFIX /include
31
36
export CPLUS_INCLUDE_PATH=$PREFIX /include
32
37
33
- export ANDROID_SDK_DIR=" $PWD /android-sdk-linux"
34
- export ANDROID_NDK_DIR=` find $PWD /* -maxdepth 0 -type d -name ' android-ndk-r*' `
35
- export ANDROID_NDK_TOOLCHAIN=" $PWD /toolchain"
38
+ [[ ! ${ANDROID_SDK_DIR : +isset} ]] && export ANDROID_SDK_DIR=" $PWD /android-sdk-linux"
39
+ [[ ! ${ANDROID_NDK_DIR : +isset} ]] && export ANDROID_NDK_DIR=` find $PWD /* -maxdepth 0 -type d -name ' android-ndk-r*' `
40
+ [[ ! ${ANDROID_NDK_TOOLCHAIN : +isset} ]] && export ANDROID_NDK_TOOLCHAIN=" $PWD /toolchain"
36
41
37
42
export gl_cv_header_working_stdint_h=yes
38
43
@@ -43,8 +48,10 @@ export LINGUAS=C
43
48
export PKG_CONFIG_LIBDIR=/foo/bar
44
49
export PKG_CONFIG_PATH=$LIBDIR /pkgconfig
45
50
46
- export PATH=" $PATH :$ANDROID_NDK_DIR :$ANDROID_NDK_TOOLCHAIN /bin"
47
- export PATH=" $PATH :$ANDROID_SDK_DIR /tools/:$ANDROID_SDK_DIR /platform-tools"
51
+ pathadd " $ANDROID_NDK_DIR "
52
+ pathadd " $ANDROID_NDK_TOOLCHAIN /bin"
53
+ pathadd " $ANDROID_SDK_DIR /tools"
54
+ pathadd " $ANDROID_SDK_DIR /platform-tools"
48
55
49
56
export NDK_MODULE_PATH=$PWD
50
57
0 commit comments