2004-06-18 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / configure
1 #!/bin/sh
2
3 help()
4 {
5         echo ""
6         echo "Usage is: configure [--prefix=PREFIX] [--profile=PROFILE]"
7         echo ""
8         echo "Profiles available: "
9         (cd build/profiles; ls *.make | sed -e 's/.make//' -e 's/^/     /')
10 }
11
12 prefix=/usr/local
13 profile=default
14
15 for a in $*; do
16         case $a in
17                 --help)
18                         help
19                         exit 0
20                         ;;
21                 --prefix=*)
22                         prefix=`echo $a | sed 's/--prefix=//'`;
23                         ;;
24                 --profile=*)
25                         profile=`echo $a | sed 's/--profile=//'`;
26                         if test ! -f build/profiles/$profile.make; then
27                                 echo ""
28                                 echo Error, profile $profile does not exist
29                                 help
30                                 exit 1;
31                         fi
32                         ;;
33                 *)
34                         echo Unknown option: $a
35                         help
36                         exit 1
37         esac
38 done
39
40 echo "prefix=$prefix" > build/config.make
41 echo "MCS_FLAGS = \$(PLATFORM_DEBUG_FLAGS)" >> build/config.make
42 echo "PROFILE=$profile" > build/pre-config.make
43
44 echo ""
45 echo "MCS module configured"
46 echo ""
47 echo "     Profile selected: $profile"
48 echo "     Prefix:           $prefix"
49 echo ""
50
51 exit 0;