Version 1.4.2: bugfixes (unhtml, deltree)
[nikiroo-utils.git] / configure.sh
1 #!/bin/sh
2
3 # default:
4 PREFIX=/usr/local
5 PROGS="java javac jar"
6
7 valid=true
8 while [ "$*" != "" ]; do
9 key=`echo "$1" | cut -c1-9`
10 val=`echo "$1" | cut -c10-`
11 case "$key" in
12 --prefix=)
13 PREFIX="$val"
14 ;;
15 *)
16 echo "Unsupported parameter: '$1'" >&2
17 valid=false
18 ;;
19 esac
20 shift
21 done
22
23 [ $valid = false ] && exit 1
24
25 MESS="A required program cannot be found:"
26 for prog in $PROGS; do
27 out="`whereis -b "$prog" 2>/dev/null`"
28 if [ "$out" = "$prog:" ]; then
29 echo "$MESS $prog" >&2
30 valid=false
31 fi
32 done
33
34 [ $valid = false ] && exit 2
35
36 if [ "`whereis tput`" = "tput:" ]; then
37 ok='"[ ok ]"';
38 ko='"[ !! ]"';
39 cols=80;
40 else
41 ok='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"';
42 ko='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"';
43 cols='"`tput cols`"';
44 fi;
45
46
47 echo "MAIN = be/nikiroo/utils/test/Test" > Makefile
48 echo "MORE = be/nikiroo/utils/StringUtils be/nikiroo/utils/IOUtils be/nikiroo/utils/MarkableFileInputStream be/nikiroo/utils/ui/UIUtils be/nikiroo/utils/ui/WrapLayout be/nikiroo/utils/ui/ProgressBar be/nikiroo/utils/resources/TransBundle" >> Makefile
49 echo "TEST = be/nikiroo/utils/test/Test" >> Makefile
50 echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
51 echo "NAME = nikiroo-utils" >> Makefile
52 echo "PREFIX = $PREFIX" >> Makefile
53 echo "JAR_FLAGS += -C bin/ be -C bin/ VERSION" >> Makefile
54 echo "SJAR_FLAGS += -C src/ be" >> Makefile
55
56 cat Makefile.base >> Makefile
57