From 6669a704f64f4220ed3d46f862b4cfd0b979c23b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 22 Sep 2022 09:04:16 +0200 Subject: _get_gcc_version_from_config(): give current gcc version if no srcdir is set --- extra/linux-pae/PKGBUILD | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'extra/linux-pae/PKGBUILD') diff --git a/extra/linux-pae/PKGBUILD b/extra/linux-pae/PKGBUILD index 6451244a..89582c86 100644 --- a/extra/linux-pae/PKGBUILD +++ b/extra/linux-pae/PKGBUILD @@ -198,11 +198,19 @@ _package-headers() { } _get_gcc_version_from_config() { - sed ' - s/^CONFIG_CC_VERSION_TEXT="gcc (GCC) \([0-9.]\+\)"$/\1/ - t - d - ' "$srcdir/$_srcname/.config" + if [ -z "$srcdir" ]; then + gcc --version \ + | sed ' + s@^.* @@ + 1!d + ' + else + sed ' + s/^CONFIG_CC_VERSION_TEXT="gcc (GCC) \([0-9.]\+\)"$/\1/ + t + d + ' "$srcdir/$_srcname/.config" + fi } _package-docs() { -- cgit v1.2.3-70-g09d2