File tree 1 file changed +34
-3
lines changed
1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,36 @@ function usage() {
223
223
exit 0
224
224
}
225
225
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
+
226
256
function run_prepare() {
227
257
info " Check enviromnent"
228
258
if [ " X$ANDROIDSDK " == " X" ]; then
@@ -593,6 +623,7 @@ function run_biglink() {
593
623
}
594
624
595
625
function run() {
626
+ check_build_deps
596
627
run_prepare
597
628
run_source_modules
598
629
run_get_packages
@@ -653,9 +684,9 @@ while getopts ":hvlfxm:d:s" opt; do
653
684
f)
654
685
DO_CLEAN_BUILD=1
655
686
;;
656
- x)
657
- DO_SET_X=1
658
- ;;
687
+ x)
688
+ DO_SET_X=1
689
+ ;;
659
690
\? )
660
691
echo " Invalid option: -$OPTARG " >&2
661
692
exit 1
You can’t perform that action at this time.
0 commit comments