diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 43 |
1 files changed, 21 insertions, 22 deletions
@@ -4,30 +4,29 @@ libs=(luajit sdl2 pangoft2) CFLAGS+=(-std=c11 -fPIC) LDFLAGS+=(-shared) -usage () { - echo "Usage: $0 [-h|options...]" -} +usage () { echo "Usage: $0 [-h|options...]"; } + help () { - echo "Options:" - echo " -B ldlib Append ldlib to LDLIBS" - echo " -C cflag Append cflag to CFLAGS" - echo " -L ldflag Append ldflag to LDFLAGS" - echo " -P cppflag Append cppflag to CPPFLAGS" - echo " -c when Enable compiler colours (always|auto|off) [default: auto]" - echo " -d Enable debugging flags" - echo " -e Enable -Werror" - echo " -h Show this help" - echo " -o Enable optimisation flags" - echo " -v Print results of configuration" - echo " -w Enable warning flags" - echo "Environment:" - echo " CC C compiler" - echo " PKG_CONFIG pkg-config" + cat <<EOF +Options: + -B ldlib Append ldlib to LDLIBS + -C cflag Append cflag to CFLAGS + -L ldflag Append ldflag to LDFLAGS + -P cppflag Append cppflag to CPPFLAGS + -c when Enable compiler colours (always|auto|off) [default: auto] + -d Enable debugging flags + -e Enable -Werror + -h Show this help + -o Enable optimisation flags + -v Print results of configuration + -w Enable warning flags +Environment: + CC C compiler + PKG_CONFIG pkg-config +EOF } -exists() { - command -v "$1" >/dev/null 2>&1 -} +exists() { command -v "$1" >/dev/null 2>&1; } check() { what=$1 @@ -76,7 +75,7 @@ while getopts B:C:L:P:c:dehovw opt; do ?) usage >&2; exit 1;; esac done -if [[ $colour == auto ]] && exists tput && (( $(tput colors) >= 8 )); then +if [[ $colour == auto && -t 1 ]]; then colour=always fi if [[ $colour == always ]]; then |