File tree Expand file tree Collapse file tree 1 file changed +34
-3
lines changed
Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,36 @@ function usage() {
223223 exit 0
224224}
225225
226+ # Check installation state of a debian package list.
227+ # Return all missing packages.
228+ function check_pkg_deb_installed() {
229+ PKGS=$1
230+ MISSING_PKGS=" "
231+ for PKG in $PKGS ; do
232+ CHECK=$( dpkg -s $PKG 2>&1 )
233+ if [ $? -eq 1 ]; then
234+ MISSING_PKGS=" $PKG $MISSING_PKGS "
235+ fi
236+ done
237+ if [ " X$MISSING_PKGS " != " X" ]; then
238+ error " Packages missing: $MISSING_PKGS "
239+ error " It might break the compilation, except if you installed thoses packages manually."
240+ fi
241+ }
242+
243+ function check_build_deps() {
244+ DIST=$( lsb_release -is)
245+ info " Check build dependencies for $DIST "
246+ case $DIST in
247+ Debian|Ubuntu)
248+ check_pkg_deb_installed " build-essential zlib1g-dev cython"
249+ ;;
250+ * )
251+ debug " Avoid check build dependencies, unknow platform $DIST "
252+ ;;
253+ esac
254+ }
255+
226256function run_prepare() {
227257 info " Check enviromnent"
228258 if [ " X$ANDROIDSDK " == " X" ]; then
@@ -593,6 +623,7 @@ function run_biglink() {
593623}
594624
595625function run() {
626+ check_build_deps
596627 run_prepare
597628 run_source_modules
598629 run_get_packages
@@ -653,9 +684,9 @@ while getopts ":hvlfxm:d:s" opt; do
653684 f)
654685 DO_CLEAN_BUILD=1
655686 ;;
656- x)
657- DO_SET_X=1
658- ;;
687+ x)
688+ DO_SET_X=1
689+ ;;
659690 \? )
660691 echo " Invalid option: -$OPTARG " >&2
661692 exit 1
You can’t perform that action at this time.
0 commit comments