6 test -e "$CONFIG_SITE" && .
"$CONFIG_SITE"
7 test "$prefix" = NONE
&& prefix
=/usr
/local
12 echo "Usage : configure [--prefix=PREFIX] [--select] [--profile=PROFILE]"
14 echo "This script allows selecting and configuring a set of MonoDevelop"
15 echo "modules to be included in an integrated build."
17 echo "The MonoDevelop build system consists of a 'main' module, which "
18 echo "contains the main distribution, and a number of additional add-ins"
19 echo "in subdirectories of 'extras'. "
21 echo "The 'extras' add-ins are designed to be built and distributed separately,"
22 echo "and therefore build against your system-installed MonoDevelop by default."
23 echo "However, this script sets them up to build against the MonoDevelop in"
24 echo "'main', and ensures that they will be loaded when MonoDevelop is launched"
25 echo "with 'make run' in this top-level directory. This is very useful for"
26 echo "development and testing."
28 echo "The first time the configure script is executed, it will ask you"
29 echo "to select the add-ins to be included in the build. Further executions"
30 echo "will configure only the selected add-ins. To select a new list of"
31 echo "add-ins, run this script using the --select option."
33 echo "You can also configure a predefined list of modules by specifying"
34 echo "a build profile using the --profile option."
38 echo "--prefix=PREFIX"
40 echo " Select the install directory prefix."
44 echo " Shows a list of add-ins and allows selecting which ones should be"
45 echo " included in the build. It can be used in combination with --profile"
46 echo " to select the add-ins to be built for a specific profile."
48 echo "--profile=PROFILE"
50 echo " Configure the build system using the provided profile."
51 echo " A 'profile' is a list of 'extras' directories and arguments for their "
52 echo " configure scripts, and arguments for the 'main' configure script. To "
53 echo " add a profile, simply create a file in the 'profiles' directory."
54 echo " The 'default' profile is used when none is specified."
56 echo " Profiles available:" `ls --format=commas profiles | sed -e "s/ChangeLog, //"`
62 test -z "$1" && return 0
63 for c
in `ls profiles`; do
64 if [ "$c" = "$1" ]; then
73 if [[ ! -a profiles
/$profile ]] ; then
74 cp profiles
/stable profiles
/$profile
77 for p
in `sed -e /#/d -e 's/ /,/g' < profiles/all` ; do
79 if test x1
== x
`grep -c -s $p profiles/$profile`; then
90 echo Select the packages to include
in the build
for the profile
\'$profile\':
93 for p
in ${packages[*]} ; do
94 echo $n.
[${selection[n]}] $p
98 echo "Enter the number of an add-in to enable/disable,"
99 read -a response
-p"(q) quit, (c) clear all, (s) select all, or ENTER to continue: "
101 if [ -z $response ] ; then
103 elif [ $response == q
-o $response == Q
] ; then
105 elif [ $response == c
-o $response == C
] ; then
106 for ((n
=1; n
< pcount
; n
++))
110 elif [ $response == s
-o $response == S
] ; then
111 for ((n
=1; n
< pcount
; n
++))
115 elif [ x
${selection[response]} = xX
] ; then
116 selection
[$response]=" "
118 selection
[$response]=X
122 rm -f profiles
/$profile
123 for p
in ${packages[*]} ; do
124 if [ x
${selection[n]} == xX
]; then
125 echo ${packages[n]} >> profiles
/$profile
131 configure_packages
()
134 localconf
=`pwd`/local-config
135 for p
in `sed -e /#/d -e 's/ /,/g' < profiles/$profile` ; do
136 path
=`echo $p | cut -d ',' -f 1`
137 ops
=`echo $p | sed -e s,$path,, -e 's/,/ /'g`
138 title
="Configuring package: $path"
139 nc
=`echo $title | wc -m`
141 for ((n
=1; n
< nc
; n
++)); do echo -n "-"; done
143 echo "Configuration options: $ops"
144 if test -a $path/autogen.sh
; then
146 elif test -a $path/configure
; then
149 echo Configuration
script not found
in directory
: $p
152 pushd $path > /dev
/null
153 PKG_CONFIG_PATH
=$localconf:$PKG_CONFIG_PATH $sct --prefix=$prefix $ops ||
exit 1
155 create_local_config
$path
156 packages
="$packages $path"
161 create_local_config
()
163 # Get the version from configure.in, if it exists
164 if test -a $path/configure.
in; then
165 ver
=`grep AC_INIT $path/configure.in | cut -d "," -f 2 | sed "s/ //"`
166 elif test -a $path/configure
; then
167 ver
=`grep ^VERSION= $path/configure | cut -d "=" -f 2 | sed "s/ //"`
172 # Copy the .pc file to local-config, and set the base lib directory
173 mkdir
-p local-config
174 builddir
=`pwd`/$path/build
175 for f
in `ls $1/*.pc.in` ; do
176 pcfile
=`echo $f | sed s,.*/,, | sed s/\.in$//`
177 sed -e s
,libdir
=.
*,libdir
=$builddir, -e s
/@VERSION@
/$ver/g
$f> local-config
/$pcfile
180 # Generate the .addins file for the package
181 addins
=local-config
/`echo $path | sed s,/,_,`.addins
182 echo "<Addins>" > $addins
183 echo " <Directory include-subdirs=\"true\">$builddir</Directory>" >> $addins
184 echo "</Addins>" >> $addins
189 while test x
$1 != x
; do
192 prefix
=`echo $1 | sed 's/--prefix=//'`
202 prof
=`echo $1 | sed 's/--profile=//'`
214 echo Unknown argument
$1 >&2
222 validate_profile
"$profile"
223 if [ ! $?
-eq 1 ]; then
224 echo "The build profile '$profile' does not exist. A new profile will be created."
226 if [ x
$select == xyes
-o ! -a profiles
/$profile ]; then
231 [ $?
-eq 1 ] && exit 1
233 echo -n "SUBDIRS = " > config.
make
235 echo Configuration Summary
236 echo ---------------------
238 echo "MonoDevelop has been configured with "
239 echo " prefix = $prefix"
240 echo " profile = $profile"
242 echo "Packages included in the build:"
243 for p
in $packages; do
244 echo "\\" >> config.
make
245 echo -n " $p" >> config.
make