From de4c35b8109cd06aae1e1b125dbbbca397111fd0 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Wed, 16 Nov 2011 12:43:53 +0700 Subject: options-parser: provide a saner pluggable API. It's much too easy to forget that the functions you hook into the option parser need to return unconsumed options in the variable `func_run_hooks_result'; better to follow the convention used in the rest of bootstrap and return results in a variable named after the function with `_result' appended. * libltdl/config/options-parser (func_run_hooks): implement this new API. (Option parsing): Update the example in the header comment for this section to reflect the changes. * bootstrap (bootstrap_options_prep, bootstrap_parse_options) (bootstrap_validate_options): Adjust. * bootstrap.conf (libtool_options_prep, libtool_parse_options) (libtool_validate_options): Ditto. Signed-off-by: Gary V. Vaughan --- bootstrap.conf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bootstrap.conf') diff --git a/bootstrap.conf b/bootstrap.conf index 0f89559e..e1537e23 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -177,7 +177,7 @@ Libtool Specific Options: # pass back the list of options we consumed func_quote_for_eval ${1+"$@"} - func_run_hooks_result="$func_quote_for_eval_result" + libtool_options_prep_result="$func_quote_for_eval_result" } func_add_hook func_options_prep libtool_options_prep @@ -185,9 +185,7 @@ func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG...] # ------------------------------ # Provide handling for additional Libtool options inside the main option -# parsing loop. Note that `bootstrap' passes in the current positional -# parameters, and this function has to pass back whatever is left after -# its own processing in the `func_run_hooks_result' variable. +# parsing loop. libtool_parse_options () { $debug_cmd @@ -217,7 +215,7 @@ libtool_parse_options () # pass back the list of options we consumed func_quote_for_eval ${1+"$@"} - func_run_hooks_result="$func_quote_for_eval_result" + libtool_parse_options_result="$func_quote_for_eval_result" } func_add_hook func_parse_options libtool_parse_options @@ -246,7 +244,7 @@ libtool_validate_options () # pass back the list of options we consumed func_quote_for_eval ${1+"$@"} - func_run_hooks_result="$func_quote_for_eval_result" + libtool_validate_options_result="$func_quote_for_eval_result" } func_add_hook func_validate_options libtool_validate_options -- cgit v1.2.1