(changelog update)
[fanfix.git] / configure.sh
CommitLineData
08fe2e33
NR
1#!/bin/sh
2
3# default:
4PREFIX=/usr/local
5PROGS="java javac jar make sed"
6
7valid=true
8while [ "$*" != "" ]; 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
21done
22
23[ $valid = false ] && exit 1
24
25MESS="A required program cannot be found:"
26for 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
32done
33
34[ $valid = false ] && exit 2
35
a6395bef
NR
36if [ "`whereis tput`" = "tput:" ]; then
37 ok='"[ ok ]"';
38 ko='"[ !! ]"';
39 cols=80;
40else
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`"';
44fi;
45
08fe2e33 46echo "MAIN = be/nikiroo/fanfix/Main" > Makefile
92fb0719 47echo "TEST = be/nikiroo/fanfix/test/Test" >> Makefile
a6395bef 48echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
08fe2e33
NR
49echo "NAME = fanfix" >> Makefile
50echo "PREFIX = $PREFIX" >> Makefile
39c3c689 51echo "JAR_FLAGS += -C bin/ org -C bin/ be -C bin/ VERSION" >> Makefile
dd56a893 52#echo "SJAR_FLAGS += -C src/ org -C src/ be -C ./ LICENSE -C ./ README.md -C ./ VERSION" >> Makefile
08fe2e33
NR
53
54cat Makefile.base >> Makefile
55