You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
codeine/configure

88 lines
1.5 KiB

#! /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