Skip to content
Snippets Groups Projects
Commit 6ecc1e32 authored by David Malcolm's avatar David Malcolm
Browse files

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: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 5bb18475
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment