aboutsummaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
author0xb10c <b10c@b10c.me>2023-06-13 14:33:58 +0200
committer0xb10c <b10c@b10c.me>2023-06-13 14:58:43 +0200
commitfc6c17b83887ef193f2b97264b1843c94dcb915d (patch)
tree580d7581366b21fdeceffc81e792045e1e74cfdb /autogen.sh
parent8de9bb7a5ab04669369e2bb59ea92a5c1a91a8d2 (diff)
build: make sure we can overwrite config.{guess,sub}
Since ea7b8528 (#26422), autogen.sh overwrites the build-aux/config.{guess, sub} files (installed there by autoreconf) with the depends/config.{guess, sub} files if these are newer. The autoreconf tool copies them from it's share/autoconf/build-aux/ directory. Specifically on NixOS, the share/autoconf/build-aux/ files are located in the nix-store and are read-only. autoreconf preserves the read-only permissions when copying. Overwriting them with our depends/config.{guess, sub} subsequently fails. To make sure we can overwrite the files, we set write permissions to the current user and group before overwriting. This fixes the problem on NixOS. fixes #27873: Can't copy to 'build-aux/config.guess' in autoconf.sh: Permission denied
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index d0ac7ef7ed..69c892ffa0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,10 +16,14 @@ command -v autoreconf >/dev/null || \
autoreconf --install --force --warnings=all
if expr "'$(build-aux/config.guess --timestamp)" \< "'$(depends/config.guess --timestamp)" > /dev/null; then
+ chmod ug+w build-aux/config.guess
+ chmod ug+w src/secp256k1/build-aux/config.guess
cp depends/config.guess build-aux
cp depends/config.guess src/secp256k1/build-aux
fi
if expr "'$(build-aux/config.sub --timestamp)" \< "'$(depends/config.sub --timestamp)" > /dev/null; then
+ chmod ug+w build-aux/config.sub
+ chmod ug+w src/secp256k1/build-aux/config.sub
cp depends/config.sub build-aux
cp depends/config.sub src/secp256k1/build-aux
fi