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