added README, license, and configure script
[assman] / configure
1 #!/bin/sh
2
3 prefix=/usr/local
4 opt=false
5 dbg=true
6 build_mod_url=true
7
8 while [ $# != 0 ]; do
9         case $1 in
10         --prefix=*)
11                 prefix=`echo $1 | sed 's/^--prefix=//'`
12                 ;;
13         --enable-opt)
14                 opt=true
15                 ;;
16         --disable-opt)
17                 opt=false
18                 ;;
19         --enable-dbg)
20                 dbg=true
21                 ;;
22         --disable-dbg)
23                 dbg=false
24                 ;;
25         --enable-url)
26                 build_mod_url=true
27                 ;;
28         --disable-url)
29                 build_mod_url=false
30                 ;;
31         esac
32         shift
33 done
34
35 echo "installation prefix: $prefix"
36 $build_mod_url && echo 'build mod_url: yes' || echo 'build mod_url: no'
37 $opt && echo 'optimizations: yes' || echo 'optimizations: no'
38 $dbg && echo 'debug symbols: yes' || echo 'debug symbols: no'
39
40 echo "Configuring assman..."
41
42 echo "# do not modify this file manually, it's generated by the configure script" >Makefile
43 echo "PREFIX = $prefix" >>Makefile
44 $opt && echo '-O3' | xargs echo 'opt =' >>Makefile
45 $dbg && echo '-g' | xargs echo 'dbg =' >>Makefile
46 if $build_mod_url; then
47         echo 'mod_url_cflags = -DBUILD_MOD_URL' >>Makefile
48         echo 'mod_url_libs = -lcurl -lpthread' >>Makefile
49 fi
50 echo '# --- end of generated part, start of Makefile.in ---' >>Makefile
51 cat Makefile.in >>Makefile
52
53 echo 'Done. Run make (or gmake) to compile.'