opts: add logic to generate options-urls.cc
Changed in v2:
- split out from the code that uses this
- now handles lang-specific URLs, as well as generic URLs
- the generated options-urls.cc now contains a function with a
switch statement, rather than an array, to support
lang-specific URLs:
const char *
get_opt_url_suffix (int option_index, unsigned lang_mask)
{
switch (option_index)
{
[...snip...]
case OPT_B:
if (lang_mask & CL_D)
return "gdc/Directory-Options.html#index-B";
return "gcc/Directory-Options.html#index-B";
[...snip...]
return nullptr;
}
gcc/ChangeLog:
* Makefile.in (ALL_OPT_URL_FILES): New.
(GCC_OBJS): Add options-urls.o.
(OBJS): Likewise.
(OBJS-libcommon): Likewise.
(s-options): Depend on $(ALL_OPT_URL_FILES), and add this to
inputs to opt-gather.awk.
(options-urls.cc): New Makefile target.
* opt-functions.awk (url_suffix): New function.
(lang_url_suffix): New function.
* options-urls-cc-gen.awk: New file.
* opts.h (get_opt_url_suffix): New decl.
Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
Loading
Please register or sign in to comment