ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / Soft / Build / check_dependencies.sh
1 #!/bin/sh
2
3 ## Author : stephane.piskorski@parrot.com
4 ## Date   : 19th,Oct. 2010
5
6
7 check()
8 {
9         if [ `cat ./temporary_file | grep $1 | wc -l` -eq 0 ] ; then 
10                 echo " $1";
11         fi
12 }
13
14 verify()
15 {
16                 packages="$packages$(check $1)";
17 }
18
19
20 packages="";
21
22 if [ `which uname` ] ; then 
23         if [ `uname -a | grep Ubuntu | wc -l` ] ; then
24
25                 echo "\033[31mChecking required Ubuntu packages ...\033[0m";  
26
27                 if [ ! -e ./temporary_file ] ; then   # check that the temp file does not exist
28                 
29                         dpkg -l > ./temporary_file;
30                 
31                         #To use FFMPEG recording
32                         #verify "libavformat-dev";
33                         #verify "libavcodec-dev";
34                         #verify "libavutil-dev";
35                         #verify "libswscale-dev";
36                         #verify "libavfilter-dev";
37
38                         #To use the Wiimote in Navigation
39                         #verify "libcwiid1-dev";
40                         #verify "libbluetooth-dev";
41                 
42                         #To compile Navigation
43                         #verify "libsdl1.2-dev";
44                         #verify "libgtk2.0-dev";
45                 verify "libxml2-dev";
46                 #verify "libudev-dev";
47                 #verify "libiw-dev";
48
49                         if [ "$packages" != "" ] ; then
50                                 echo "You should install the following packages to compile the Mykonos project with Ubuntu:\n $packages";
51                                 echo "Do you want to install them now [y/n] ?";
52                                 read user_answer ;
53                                 if [ "$user_answer" = "y" ]; then
54                                         sudo apt-get install $packages;
55                                 fi
56                         else
57                                 echo "ok.";
58                         fi
59                 
60                         rm      ./temporary_file;
61                 fi
62         fi
63 fi
64