From db77c2079ee0aebd0340016791380ce26e751935 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 22 Jan 2013 17:23:05 +0800 Subject: [PATCH] Updated make-all-linux-probject.sh. Checked whether packages were installed. --- make-all-linux-project.sh | 51 +++++++++++++++------------------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/make-all-linux-project.sh b/make-all-linux-project.sh index 858350830e..dff0a12f97 100755 --- a/make-all-linux-project.sh +++ b/make-all-linux-project.sh @@ -15,41 +15,28 @@ check_make_result() fi } -DIR_GLEW170=$COCOS2DX20_TRUNK/cocos2dx/platform/third_party/linux/glew-1.7.0/ -if ! test -d $DIR_GLEW170/glew-1.7.0/; then - echo -e $TXTCOLOR_GREEN"it is the first time you run this linux project, some depends lib should be install"$TXTCOLOR_DEFAULT; - DEPENDS='libx11-dev' - DEPENDS+=' libxmu-dev' - DEPENDS+=' libglu1-mesa-dev' - DEPENDS+=' libgl2ps-dev' - DEPENDS+=' libxi-dev' - DEPENDS+=' libglfw-dev' - DEPENDS+=' g++' - DEPENDS+=' libzip-dev' - DEPENDS+=' libcurl4-gnutls-dev' - DEPENDS+=' libfontconfig1-dev' - DEPENDS+=' libsqlite3-dev' - DEPENDS+=' glew-dev' +DEPENDS='libx11-dev' +DEPENDS+=' libxmu-dev' +DEPENDS+=' libglu1-mesa-dev' +DEPENDS+=' libgl2ps-dev' +DEPENDS+=' libxi-dev' +DEPENDS+=' libglfw-dev' +DEPENDS+=' g++' +DEPENDS+=' libzip-dev' +DEPENDS+=' libcurl4-gnutls-dev' +DEPENDS+=' libfontconfig1-dev' +DEPENDS+=' libsqlite3-dev' +DEPENDS+=' libglew-dev' - for i in $DEPENDS; do - echo -e $TXTCOLOR_GREEN"sudo apt-get install $i, please enter your password:"$TXTCOLOR_DEFAULT - sudo apt-get install $i - done - -# DIR_GLEW170=$COCOS2DX20_TRUNK/cocos2dx/platform/third_party/linux/glew-1.7.0/ - if ! test -d $DIR_GLEW170/glew-1.7.0/; then - cd $DIR_GLEW170 - echo -e $TXTCOLOR_GREEN"building glew-1.7.0 ..."$TXTCOLOR_DEFAULT; - tar -zxf glew-1.7.0.tgz - make -C ./glew-1.7.0/ - cd - +for i in $DEPENDS; do + PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed") + echo Checking for $i: $PKG_OK + if [ "" == "$PKG_OK" ]; then + echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT + sudo apt-get --force-yes --yes install $i fi -fi +done -#OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/Debug/ -#if ! test -d $OUTPUT_DEBUG; then -# mkdir $OUTPUT_DEBUG -p -#fi mkdir -p $OUTPUT_DEBUG mkdir -p $OUTPUT_RELEASE