Import madtty, use it to deal with colors from now on as it needs to know what is...
[apps/madmutt.git] / configure
1 #! /bin/sh
2
3 cd $(dirname $0)
4
5 do_makefile() {
6     dir=$(dirname $1)
7     case $dir in
8         ./*/*/*)  rel="../../..";;
9         ./*/*)    rel="../.."   ;;
10         ./*)      rel=".."      ;;
11         .)        rel="."       ;;
12         *)        echo "cannot guess deepness of '$dir'"; exit 1
13     esac
14     echo "all %: ; @\$(MAKE) -s -C $rel/build/$dir \$*" >  $dir/Makefile
15 }
16
17 find . -name CMakeLists.txt | while read file; do do_makefile $file; done
18
19 builddir=.build-$(hostname)-$(gcc -dumpmachine)-$(gcc -dumpversion)
20 rm -rf $builddir
21 mkdir -p $builddir
22 rm -f build && ln -s $builddir build
23 rm -f madmutt && ln -s $builddir/madmutt madmutt
24
25 if test $# -eq 0; then
26     (cd $builddir && cmake -DWITH_NNTP=1 -DWITH_IDN=1 -DUSE_HCACHE=1 -DCMAKE_INSTALL_PREFIX=/usr ..)
27 else
28     (cd $builddir && cmake "$@" ..)
29 fi
30
31 make -C tools