2010-07-09 Atsushi Enomoto <atsushi@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 while [ $# -ne 0 ]; do
16   case $1 in
17     --help)  
18         help
19         exit 0
20         ;;
21     --prefix=*)
22         prefix=`echo $1 | sed 's/--prefix=//'`;
23         shift
24         ;;
25     --prefix)
26         shift
27         prefix="$1"
28         shift
29         ;;
30     --profile=*)
31         profile=`echo $1 | sed 's/--profile=//'`
32         shift
33         if test ! -f build/profiles/$profile.make; then
34             echo ""
35             echo Error, profile $profile does not exist
36             help
37             exit 1;
38         fi
39         ;;
40     --profile)
41         shift
42         profile="$1"
43         shift
44         if test ! -f build/profiles/$profile.make; then
45             echo ""
46             echo Error, profile $profile does not exist
47             help
48             exit 1;
49         fi
50         ;;
51     *)
52         echo Unknown option: $1
53         help
54         shift
55   esac
56 done
57
58 echo "prefix=$prefix" > build/config.make
59 echo "MCS_FLAGS = \$(PLATFORM_DEBUG_FLAGS)" >> build/config.make
60 echo "PROFILE=$profile" > build/pre-config.make
61
62 echo ""
63 echo "MCS module configured"
64 echo ""
65 echo "     Profile selected: $profile"
66 echo "     Prefix:           $prefix"
67 echo ""
68
69 exit 0;