Add to git.
[monolith.git] / configure
1 #!/bin/sh -
2 #
3 # This is make+. Make+ is a set of scripts which enhance GNU make and
4 # let you build RPMs, and other packages types with just one control
5 # file. Read more at http://www.annexia.org/freeware/makeplus/
6 #
7 # The original author is Richard W.M. Jones <rich@annexia.org>.
8 #
9 # This software has been explicitly placed in the PUBLIC DOMAIN.  You
10 # do not need any sort of license or agreement to use or copy this
11 # software. You may also copyright this software yourself, and/or
12 # relicense it under any terms you want, at any time and at no cost.
13 # This allows you (among other things) to include this software with
14 # other packages so that the user does not need to download and
15 # install make+ separately.
16
17 mp_options=""
18
19 usage ()
20 {
21     cat <<EOF
22 ./configure [--options]
23
24 Installation directory options:
25   --prefix=PREFIX       Installation prefix [default: /usr/local]
26   --sysconfdir=SYSCONF  Installation prefix for configuration files
27                          [default: PREFIX/etc]
28   --localstatedir=STATE Installation prefix for writable files
29                          [default: PREFIX/var]
30
31 Help options:
32   --help                Display this help and exit.
33   --print-mp-cmd        Display the make+ command and exit (use as final arg)
34 EOF
35     exit 1
36 }
37
38 while [ $# -gt 0 ]; do
39     opt=$1 ; shift
40
41     case "$opt" in
42         --help)
43             usage
44             ;;
45         --print-mp-cmd)
46             echo "rm -f build-\*/config.mk"
47             echo "make+ $mp_options configure"
48             exit 0
49             ;;
50         --*prefix|--*dir)
51             opt=`echo $opt | sed 's/^--//'`
52             arg=$1 ; shift
53             mp_options="$mp_options $opt=$arg"
54             ;;
55         --*prefix=*|--*dir=*)
56             opt=`echo $opt | sed 's/^--//'`
57             mp_options="$mp_options $opt"
58             ;;
59         *)
60             mp_options="$mp_options $opt"
61             ;;
62     esac
63 done
64
65 rm -f build-*/config.mk
66 make+ $mp_options configure