tidy up vopt helpers
This commit is contained in:
parent
4eae6532c3
commit
62b3c65d77
1 changed files with 2 additions and 3 deletions
|
@ -1,8 +1,7 @@
|
||||||
# vim: set ts=4 sw=4 et:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
|
||||||
vopt_if() {
|
vopt_if() {
|
||||||
local opt="$1" t="$2" f="$3"
|
local name="build_option_$1" t="$2" f="$3"
|
||||||
name="build_option_$opt"
|
|
||||||
if [ ${!name} ]; then
|
if [ ${!name} ]; then
|
||||||
echo -n "$t"
|
echo -n "$t"
|
||||||
else
|
else
|
||||||
|
@ -12,7 +11,7 @@ vopt_if() {
|
||||||
|
|
||||||
vopt_with() {
|
vopt_with() {
|
||||||
local opt="$1" flag="${2:-$1}"
|
local opt="$1" flag="${2:-$1}"
|
||||||
vopt_if "$1" "--with-${flag}" "--without-${flag}"
|
vopt_if "$opt" "--with-${flag}" "--without-${flag}"
|
||||||
}
|
}
|
||||||
|
|
||||||
vopt_enable() {
|
vopt_enable() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue