Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core/linux/PKGBUILD
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-09-22 09:04:16 +0200
committerErich Eckner <git@eckner.net>2022-09-22 09:04:16 +0200
commit6669a704f64f4220ed3d46f862b4cfd0b979c23b (patch)
treeeafda4f30ef576edc8fec8cd4775a3ff0c4411e7 /core/linux/PKGBUILD
parentea244258c56590b1b2c831151d36be8821128959 (diff)
_get_gcc_version_from_config(): give current gcc version if no srcdir is set
Diffstat (limited to 'core/linux/PKGBUILD')
-rw-r--r--core/linux/PKGBUILD18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/linux/PKGBUILD b/core/linux/PKGBUILD
index 6eea3bd4..cbe8ed7c 100644
--- a/core/linux/PKGBUILD
+++ b/core/linux/PKGBUILD
@@ -34,11 +34,19 @@ eval "$(
)"
_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
}
# use our tarballer instead of cloning from git