From 6edd388722255975e373cd856441cdf7e0aa52d7 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 18 May 2008 10:30:06 -0500 Subject: [PATCH] More build cleanup. --- configure | 4 +--- scripts/config-funcs | 36 +++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/configure b/configure index b5521f7..891dfc7 100755 --- a/configure +++ b/configure @@ -5,8 +5,6 @@ . scripts/config-funcs -[ $# -gt 0 ] && fatal "This is not an autoconf script. Run it without any options and you will be prompted." - begin begin_options @@ -17,7 +15,7 @@ ask "Build for debugging?" USE_DEBUG no begin_tests -require_FLTK 1 1 7 +require_FLTK 1.1.7 images require_command FLUID fluid require_package JACK 0.103.0 jack require_package libsndfile 1.0.17 sndfile diff --git a/scripts/config-funcs b/scripts/config-funcs index 8575e5a..5fd771e 100644 --- a/scripts/config-funcs +++ b/scripts/config-funcs @@ -7,12 +7,15 @@ # support functions for 'configure' scripts. + fatal () { echo "$BOLD$RED$*$SGR0" > /dev/stderr exit 255 } +[ $# -gt 0 ] && fatal "This is not an autoconf script. Run it without any options and you will be prompted." + ask () { local A D @@ -148,17 +151,28 @@ require_package () return 0 } +_test_version () +{ + [ $1 $4 $5 ] && [ $2 $4 $6 ] && [ $3 $4 $7 ] +} + +test_version () +{ + local IFS + IFS='.' + + _test_version $1 $2 $3 +} + require_FLTK () { + local use + echo -n "Checking for ${BOLD}FLTK${SGR0}..." FLTK_VERSION=`fltk-config --version` - FLTK_VERSION_MAJOR=`echo $FLTK_VERSION | cut -d'.' -f1` - FLTK_VERSION_MINOR=`echo $FLTK_VERSION | cut -d'.' -f2` - FLTK_VERSION_MICRO=`echo $FLTK_VERSION | cut -d'.' -f3` - - if ! ( [ $FLTK_VERSION_MAJOR -ge $1 ] && [ $FLTK_VERSION_MINOR -ge $2 ] && [ $FLTK_VERSION_MICRO -ge $3 ] ) + if ! test_version $FLTK_VERSION -ge $1 then failed fatal "The installed FLTK version ($FLTK_VERSION) is too old." @@ -166,6 +180,14 @@ require_FLTK () ok fi - append "FLTK_LIBS=`fltk-config --use-images --ldflags`" - append "FLTK_CFLAGS=`fltk-config --cflags`" + use= + + while [ $# -gt 1 ] + do + shift 1 + use="$use --use-$1" + done + + append "FLTK_LIBS=`fltk-config $use --ldflags`" + append "FLTK_CFLAGS=`fltk-config $use --cflags`" }