*) as_fn_error $? "documentation root URL does not end with /" "$LINENO" 5 ;;
esac
else
- DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/"
+
+ docroot_url_suffix=
+ case "$gcc_version" in
+ *.[123456].0) docroot_url_suffix="gcc-$gcc_version/";;
+ *.[123456].1) docroot_url_suffix="gcc-`echo $gcc_version | sed 's/1$/0/'`/";;
+ esac
+ DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/$docroot_url_suffix"
fi
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21572 "configure"
+#line 21578 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21678 "configure"
+#line 21684 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
no) AC_MSG_ERROR([documentation root URL not specified]) ;;
*/) DOCUMENTATION_ROOT_URL="$withval" ;;
*) AC_MSG_ERROR([documentation root URL does not end with /]) ;;
- esac],
- DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/"
-)
+ esac],[
+ docroot_url_suffix=
+changequote(,)dnl
+ case "$gcc_version" in
+ *.[123456].0) docroot_url_suffix="gcc-$gcc_version/";;
+ *.[123456].1) docroot_url_suffix="gcc-`echo $gcc_version | sed 's/1$/0/'`/";;
+ esac
+changequote([,])dnl
+ DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/$docroot_url_suffix"
+])
AC_DEFINE_UNQUOTED(DOCUMENTATION_ROOT_URL,"$DOCUMENTATION_ROOT_URL",
[Define to the root for documentation URLs.])
Specify the URL root that contains GCC option documentation. The @var{url}
should end with a @code{/} character.
-The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}.
+The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}
+on the GCC main development trunk. On release branches, the default
+is @code{https://gcc.gnu.org/onlinedocs/gcc-@var{major}.@var{minor}.0/}.
@item --with-changes-root-url=@var{url}
Specify the URL root that contains information about changes in GCC
#include "gcc-urlifier.h"
#include "opts.h"
#include "options.h"
-#include "diagnostic-core.h"
#include "selftest.h"
namespace {
if (!doc_url_suffix)
return nullptr;
- char infix[32];
- /* On release branches, append to DOCUMENTATION_ROOT_URL the
- subdirectory with documentation of the latest release made
- from the branch. */
- if (BUILDING_GCC_MINOR != 0 && BUILDING_GCC_PATCHLEVEL <= 1U)
- sprintf (infix, "gcc-%u.%u.0/",
- BUILDING_GCC_MAJOR, BUILDING_GCC_MINOR);
- else
- infix[0] = '\0';
- return concat (DOCUMENTATION_ROOT_URL, infix, doc_url_suffix, nullptr);
+ return concat (DOCUMENTATION_ROOT_URL, doc_url_suffix, nullptr);
}
} // anonymous namespace
{
label_text url_suffix = get_option_url_suffix (option_index, lang_mask);
if (url_suffix.get ())
- {
- char infix[32];
- /* On release branches, append to DOCUMENTATION_ROOT_URL the
- subdirectory with documentation of the latest release made
- from the branch. */
- if (BUILDING_GCC_MINOR != 0 && BUILDING_GCC_PATCHLEVEL <= 1U)
- sprintf (infix, "gcc-%u.%u.0/",
- BUILDING_GCC_MAJOR, BUILDING_GCC_MINOR);
- else
- infix[0] = '\0';
- return concat (DOCUMENTATION_ROOT_URL, infix, url_suffix.get (),
- nullptr);
- }
+ return concat (DOCUMENTATION_ROOT_URL, url_suffix.get (), nullptr);
}
return nullptr;