Welcome to mirror list, hosted at ThFree Co, Russian Federation.

configure - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fccd182f262f7bb1921168352d27ed954c406e6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/bin/bash
VERSION=0.17
prefix=/usr/local
profile=stable

usage ()
{
	echo "Usage : configure [--prefix=PREFIX] [--profile=PROFILE]"
	echo ""
	echo "The MonoDevelop build system consists of 'main', which contains the "
	echo "main distribution, and a number of additional addins in subdirectories "
	echo "of 'extras'. The 'extras' addins are designed to be built and "
	echo "distributed separately, and therefore build against your system- "
	echo "installed MonoDevelop by default. However, this script sets them up to "
	echo "build against the MonoDevelop in 'main', and ensures that they will be "
	echo "loaded when MonoDevelop is launched with 'make run' in this top-level"
	echo "directory. This is very useful for development and testing."
	echo ""
	echo "A 'profile' is a list of 'extras' directories and arguments for their "
	echo "configure scripts, and arguments for the 'main' configure script. To "
	echo "add a profile, simply create a file in the 'profiles' directory."
	echo ""
	echo "Profiles available :"
	ls -1 profiles
}

validate_profile ()
{
	test -z "$1" && return 0
	for c in `ls profiles`; do
		if [ "$c" = "$1" ]; then
			return 1
		fi
	done
	return 0
}

configure_packages ()
{
	rm -f local-config/*
	localconf=`pwd`/local-config
	for p in `sed -e /#/d -e 's/ /,/g' < profiles/$profile` ; do
		path=`echo $p | cut -d ',' -f 1`
		ops=`echo $p | sed -e s,$path,, -e 's/,/ /'g`
		title="Configuring package: $path"
		nc=`echo $title | wc -m`
		echo $title
		for ((n=1; n < nc; n++)); do echo -n "-"; done
		echo
		echo "Configuration options: $ops"
		if test -a $path/autogen.sh; then
			sct=./autogen.sh
		elif test -a $path/configure; then
			sct=./configure
		else
			echo Configuration script not found in directory: $p
			exit 1
		fi
		pushd $path > /dev/null
		PKG_CONFIG_PATH=$localconf:$PKG_CONFIG_PATH $sct --prefix=$prefix $ops || exit 1
		popd > /dev/null
		create_local_config $path
		packages="$packages $path"
	done
	return 0
}

create_local_config ()
{
	# Get the version from configure.in, if it exists
	if test -a $path/configure.in; then
		ver=`grep AC_INIT $path/configure.in | cut -d "," -f 2 | sed "s/ //"`
	elif test -a $path/configure; then
		ver=`grep ^VERSION= $path/configure | cut -d "=" -f 2 | sed "s/ //"`
	else
		ver=VERSION
	fi

	# Copy the .pc file to local-config, and set the base lib directory
	mkdir -p local-config
	builddir=`pwd`/$path/build
	for f in `ls $1/*.pc.in` ; do
		pcfile=`echo $f | sed s,.*/,, | sed s/\.in$//`
		sed -e s,libdir=.*,libdir=$builddir, -e s/@VERSION@/$ver/g $f> local-config/$pcfile
	done
	
	# Generate the .addins file for the package
	addins=local-config/`echo $path | sed s,/,_,`.addins
	echo "<Addins>" > $addins
	echo "  <Directory include-subdirs=\"true\">$builddir</Directory>" >> $addins
	echo "</Addins>" >> $addins
}

while test x$1 != x; do
	case $1 in
		--prefix=*)
			prefix=`echo $1 | sed 's/--prefix=//'`
			;;
		--prefix)
			shift
			prefix=$1
			;;
		--profile=*)
			prof=`echo $1 | sed 's/--profile=//'`
			validate_profile "$prof"
			if [ $? -eq 1 ]; then
				profile=$prof
			else
				echo "Invalid profile name - $conf"
				usage
				exit 1
			fi
			;;
		--profile)
			shift
			prof=$1
			validate_profile "$prof"
			if [ $? -eq 1 ]; then
				profile=$prof
			else
				echo "Invalid profile name - $conf"
				usage
				exit 1
			fi
			;;
		--help)
			usage
			exit
			;;
		*)
			echo Unknown argument $1 >&2
			usage
			exit 1
			;;
	esac
	shift
done

configure_packages
[ $? -eq 1 ] && exit 1

echo -n "SUBDIRS = " > config.make

echo Configuration Summary
echo ---------------------
echo
echo "MonoDevelop has been configured with "
echo "    prefix = $prefix"
echo "    profile = $profile"
echo
echo "Packages included in the build:"
for p in $packages; do
	echo "\\" >> config.make
	echo -n "	$p" >> config.make
	echo "    $p"
done
echo >> config.make
echo