diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/configure b/configure new file mode 100755 index 0000000..83b4ab9 --- /dev/null +++ b/configure @@ -0,0 +1,87 @@ +#! /bin/sh +# TODO parse each passed argument and remove any "--" prefix + +BOLD="\033[1m" +RED="\033[91m" +GREEN="\033[92m" +YELLOW="\033[93m" +CYAN="\033[96m" +NORMAL="\033[0m" + +if command -v scons >/dev/null 2>&1; +then + SCONS=scons +else + if [ ! -e "scons/scons" ]; then + echo "" + echo -ne "Unpacking mini-scons..."$RED + + pushd scons >/dev/null 2>&1 + tar xjvf scons-mini.tar.bz2 > /dev/null 2>&1 + + if [[ "$?" == "0" ]]; then + echo -e $GREEN"done"$NORMAL + else + echo -e $RED"failed!"$NORMAL + exit 2 + fi + + popd > /dev/null + fi + + SCONS=scons/scons +fi + +if [[ "$1" == "--help" ]]; then + $SCONS -Q configure --help + exit +fi + +echo "" +echo "Configuring Codeine "`cat VERSION`"..." +echo "" + +#TODO remove all prefixed "--" + +$SCONS -Q configure $@ || exit 1 + +echo "" +echo -e "Your configure completed "$GREEN"successfully"$NORMAL", now type "$BOLD"make"$NORMAL +echo "" + +cat > Makefile << EOF +## Makefile automatically generated by unpack_local_scons.sh + +SCONS=$SCONS + +# scons : compile +# scons -c : clean +# scons install : install +# scons -c install : uninstall and clean + +# default target : use scons to build the programs +all: + \$(SCONS) -Q + +### There are several possibilities to help debugging : +# scons --debug=explain, scons --debug=tree .. +# +### To optimize the runtime, use +# scons --max-drift=1 --implicit-deps-unchanged +debug: + \$(SCONS) -Q --debug=tree + +clean: + \$(SCONS) -c + +install: + \$(SCONS) install + +uninstall: + \$(SCONS) -c install + +## this target creates a tarball of the project +dist: + \$(SCONS) dist +EOF + |