Build cleanups. Don't require sed in configure.

pull/3/head
Jonathan Moore Liles 2008-05-18 09:50:42 -05:00
parent 3e1a32c8be
commit 38f191eb41
1 changed files with 23 additions and 10 deletions

View File

@ -33,7 +33,7 @@ ask ()
esac esac
fi fi
echo "${2}=${A:-$D}" >> make.conf append "${2}=${A:-$D}"
} }
ok () ok ()
@ -56,14 +56,26 @@ using ()
extract_options () extract_options ()
{ {
local OIFS local line;
if [ -f make.conf ] if [ -f make.conf ]
then then
OIFS="$IFS" {
IFS='' while read line
eval "`sed -n '/^## options/{ : i; /^## libs/{ q }; p; n; b i }' make.conf`" do
IFS="$OIFS" [ "$line" = "## options" ] && break
done
while read line
do
if [ "$line" = "## libs" ]
then
break
else
eval "$line"
fi
done
} < make.conf
fi fi
} }
@ -71,7 +83,6 @@ begin ()
{ {
echo -n "Checking sanity..." echo -n "Checking sanity..."
require_command pkg-config pkg-config > /dev/null require_command pkg-config pkg-config > /dev/null
require_command sed sed > /dev/null
ok ok
} }
@ -80,15 +91,16 @@ begin_options ()
# get the old values # get the old values
extract_options extract_options
echo "# This file was automatically generated on `date`. Any changes may be lost!" > make.conf echo > make.conf
echo "## options" >> make.conf append "# This file was automatically generated on `date`. Any changes may be lost!"
append "## options"
echo "--- Configuration required ---" echo "--- Configuration required ---"
} }
begin_tests () begin_tests ()
{ {
echo "## libs" >> make.conf append "## libs"
extract_options extract_options
} }
@ -100,6 +112,7 @@ append ()
end () end ()
{ {
echo "--- Configuration complete ---" echo "--- Configuration complete ---"
touch make.conf
} }
require_command () require_command ()