summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-03-31 03:47:30 +0100
committerSam James <sam@gentoo.org>2021-04-11 20:59:56 +0000
commit4575a79c002ebac5b979164fd7e15fddfe91f331 (patch)
treea1d2f9754ef1d48455ebdf147876c8b6bd678328 /eclass/gnuconfig.eclass
parentautotools.eclass: rename configure.in to configure.ac on new EAPIs (diff)
downloadgentoo-4575a79c002ebac5b979164fd7e15fddfe91f331.tar.gz
gentoo-4575a79c002ebac5b979164fd7e15fddfe91f331.tar.bz2
gentoo-4575a79c002ebac5b979164fd7e15fddfe91f331.zip
gnuconfig.eclass: provide basic @ECLASS block, docs
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass/gnuconfig.eclass')
-rw-r--r--eclass/gnuconfig.eclass43
1 files changed, 33 insertions, 10 deletions
diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index 3433837787c2..24f2714b6c18 100644
--- a/eclass/gnuconfig.eclass
+++ b/eclass/gnuconfig.eclass
@@ -1,25 +1,40 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-#
-# Author: Will Woods <wwoods@gentoo.org>
-#
+
+# @ECLASS: gnuconfig.eclass
+# @MAINTAINER:
+# Sam James <sam@gentoo.org>
+# @AUTHOR:
+# Will Woods <wwoods@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7
+# @BLURB: Refresh bundled gnuconfig files (config.guess, config.sub)
+# @DESCRIPTION:
# This eclass is used to automatically update files that typically come with
# automake to the newest version available on the system. The most common use
# of this is to update config.guess and config.sub when configure dies from
# misguessing your canonical system name (CHOST). It can also be used to update
# other files that come with automake, e.g. depcomp, mkinstalldirs, etc.
#
-# usage: gnuconfig_update [file1 file2 ...]
+
+DEPEND="sys-devel/gnuconfig"
+
+if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
+ _GNUCONFIG_CLASS=1
+
+BDEPEND="sys-devel/gnuconfig"
+
+[[ ${EAPI} == [56] ]] && DEPEND="${BDEPEND}"
+
+# @FUNCTION: gnuconfig_update
+# @USAGE: [file1 file2 ...]
+# @DESCRIPTION:
# if called without arguments, config.guess and config.sub will be updated.
# All files in the source tree ($S) with the given name(s) will be replaced
# with the newest available versions chosen from the list of locations in
# gnuconfig_findnewest(), below.
#
# gnuconfig_update should generally be called from src_unpack()
-
-
-DEPEND="sys-devel/gnuconfig"
-
+#
# Wrapper function for gnuconfig_do_update. If no arguments are given, update
# config.sub and config.guess (old default behavior), otherwise update the
# named files.
@@ -42,6 +57,9 @@ gnuconfig_update() {
return $?
}
+# @FUNCTION: gnuconfig_do_update
+# @INTERNAL
+# @DESCRIPTION:
# Copy the newest available version of specified files over any old ones in the
# source dir. This function shouldn't be called directly - use gnuconfig_update
#
@@ -75,7 +93,10 @@ gnuconfig_do_update() {
return 0
}
-# this searches the standard locations for the newest config.{sub|guess}, and
+# @FUNCTION: gnuconfig_findnewest
+# @INTERNAL
+# @DESCRIPTION:
+# This searches the standard locations for the newest config.{sub|guess}, and
# returns the directory where they can be found.
gnuconfig_findnewest() {
local locations=(
@@ -88,3 +109,5 @@ gnuconfig_findnewest() {
sort -r -n -t\' -k2 | \
sed -n '1{s,/config.sub:.*$,,;p;q}'
}
+
+fi