* Makefile.am:
[monodevelop.git] / extras / MonoDevelop.AddinAuthoring / configure
blobb501306136e1e440b27e8b53dc90d630704fa539
1 #!/bin/bash
2 VERSION=0.2
3 PACKAGE=monodevelop_addinauthoring
4 prefix=/usr/local
5 config=DEBUG
6 configurations=" RELEASE DEBUG"
7 common_packages=" monodevelop;1.9.2 gtk-sharp-2.0;2.8.3 mono-addins-setup;0.3 mono-addins;0.3"
10 usage ()
12 echo "Usage : configure [--prefix=PREFIX] [--config=CONFIG]"
13 echo
14 echo "Configurations available :"
15 for c in $configurations; do
16 if [ "$c" = "$config" ]; then
17 echo " $c (Default)"
18 else
19 echo " $c"
21 done
24 validate_config ()
26 test -z "$1" && return 0
27 for c in $configurations; do
28 if [ "$c" = "$1" ]; then
29 return 1
31 done
32 return 0
35 check_package ()
37 name=`echo $1 | cut -d\; -f1`
38 version=`echo $1 | cut -d\; -f2`
40 echo -n "Checking for package '$name'.." | tee -a config.log
41 pkg-config --atleast-version=$version $name
42 if [ $? -ne 0 ]; then
43 echo " ERROR: Package named '$name' >= $version not found." | tee -a config.log
44 echo "Try adjusting your PKG_CONFIG_PATH environment variable." | tee -a config.log
45 return 1
47 echo " found." | tee -a config.log
50 check_required_packages ()
52 echo "Looking for required packages" | tee config.log
53 var=required_packages_$config
54 for pkg in $common_packages ${!var}; do
55 check_package $pkg
56 retval=$?
57 [ $retval -ne 0 ] && return $retval
58 done
59 return 0
62 while test x$1 != x; do
63 case $1 in
64 --prefix=*)
65 prefix=`echo $1 | sed 's/--prefix=//'`
67 --prefix)
68 shift
69 prefix=$1
71 --config=*)
72 conf=`echo $1 | sed 's/--config=//'`
73 validate_config "$conf"
74 if [ $? -eq 1 ]; then
75 config=$conf
76 else
77 echo "Invalid config name - $conf"
78 usage
79 exit 1
82 --help)
83 usage
84 exit
87 echo Unknown argument $1 >&2
88 usage
89 exit 1
91 esac
92 shift
93 done
95 check_required_packages
96 [ $? -eq 1 ] && exit 1
98 echo "prefix=$prefix" > config.make
99 echo "RUNTIME=mono" >> config.make
100 echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make
101 echo "VERSION=$VERSION" >> config.make
102 echo "PACKAGE=$PACKAGE" >> config.make
103 echo "CONFIG=$config" >> config.make
105 echo
106 echo "$PACKAGE has been configured with "
107 echo " prefix = $prefix"
108 echo " config = $config"
109 echo