More build cleanups.

This commit is contained in:
Jonathan Moore Liles 2008-05-17 23:28:36 -05:00
parent 5cb015d6bb
commit 0d9fe2b9b8
3 changed files with 32 additions and 15 deletions

View File

@ -16,7 +16,7 @@ make.conf: configure
-include make.conf -include make.conf
ifeq ($(MAINTAINER_MODE),yes) ifeq ($(USE_DEBUG),yes)
CXXFLAGS := -pipe -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions CXXFLAGS := -pipe -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions
else else
CXXFLAGS := -pipe -O3 -fno-rtti -fno-exceptions -DNDEBUG CXXFLAGS := -pipe -O3 -fno-rtti -fno-exceptions -DNDEBUG

6
configure vendored
View File

@ -12,8 +12,8 @@ begin
begin_options begin_options
ask "Install prefix?" prefix /usr/local ask "Install prefix?" prefix /usr/local
ask "Use LASH?" USE_LASH yes ask "Require LASH?" USE_LASH yes
ask "Build for debugging?" MAINTAINER_MODE no ask "Build for debugging?" USE_DEBUG no
begin_tests begin_tests
@ -22,6 +22,6 @@ require_command FLUID fluid
require_package JACK 0.103.0 jack require_package JACK 0.103.0 jack
require_package libsndfile 1.0.17 sndfile require_package libsndfile 1.0.17 sndfile
[ $USE_LASH = yes ] && require_package LASH 0.5.4 lash-1.0 using LASH && require_package LASH 0.5.4 lash-1.0
end end

View File

@ -15,14 +15,25 @@ fatal ()
ask () ask ()
{ {
local answer default local A D
default="`eval echo \\$$2`" D="`eval echo \\$$2`"
default=${default:-$3} D=${D:-$3}
echo -n "$BLACK$BOLD::$SGR0 $1 [$BOLD${default}$SGR0] " echo -n "$BLACK$BOLD::$SGR0 $1 [$BOLD${D}$SGR0] "
read answer read A
echo "${2}=${answer:-$default}" >> make.conf A=${A:-$D}
if [ "$3" = yes ] || [ "$3" = no ]
then
case "$A" in
no | n | N) A=no ;;
yes | y | Y) A=yes ;;
* ) fatal "Invalid response. Must be 'yes' or 'no'" ;;
esac
fi
echo "${2}=${A:-$D}" >> make.conf
} }
ok () ok ()
@ -36,6 +47,13 @@ failed ()
rm -f make.conf rm -f make.conf
} }
using ()
{
[ "`eval echo \\$USE_$1`" = yes ]
return $?
}
extract_options () extract_options ()
{ {
local OIFS local OIFS
@ -62,7 +80,7 @@ begin_options ()
# get the old values # get the old values
extract_options extract_options
echo "# This is a generated file. Any changes may be lost!" > make.conf echo "# This file was automatically generated on `date`. Any changes may be lost!" > make.conf
echo "## options" >> make.conf echo "## options" >> make.conf
echo "--- Configuration required ---" echo "--- Configuration required ---"
@ -70,7 +88,7 @@ begin_options ()
begin_tests () begin_tests ()
{ {
echo "## libs/flags" >> make.conf echo "## libs" >> make.conf
extract_options extract_options
} }
@ -117,7 +135,6 @@ require_package ()
return 0 return 0
} }
require_FLTK () require_FLTK ()
{ {
echo -n "Checking for ${BOLD}FLTK${SGR0}..." echo -n "Checking for ${BOLD}FLTK${SGR0}..."
@ -126,9 +143,9 @@ require_FLTK ()
FLTK_VERSION_MAJOR=`echo $FLTK_VERSION | cut -d'.' -f1` FLTK_VERSION_MAJOR=`echo $FLTK_VERSION | cut -d'.' -f1`
FLTK_VERSION_MINOR=`echo $FLTK_VERSION | cut -d'.' -f2` FLTK_VERSION_MINOR=`echo $FLTK_VERSION | cut -d'.' -f2`
FLTK_VERSION_PATCH=`echo $FLTK_VERSION | cut -d'.' -f3` FLTK_VERSION_MICRO=`echo $FLTK_VERSION | cut -d'.' -f3`
if ! ( [ $FLTK_VERSION_MAJOR -ge $1 ] && [ $FLTK_VERSION_MINOR -ge $2 ] && [ $FLTK_VERSION_PATCH -ge $3 ] ) if ! ( [ $FLTK_VERSION_MAJOR -ge $1 ] && [ $FLTK_VERSION_MINOR -ge $2 ] && [ $FLTK_VERSION_MICRO -ge $3 ] )
then then
failed failed
fatal "The installed FLTK version ($FLTK_VERSION) is too old." fatal "The installed FLTK version ($FLTK_VERSION) is too old."