mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
fc6c17b838
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
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Copyright (c) 2013-2019 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
export LC_ALL=C
|
|
set -e
|
|
srcdir="$(dirname "$0")"
|
|
cd "$srcdir"
|
|
if [ -z "${LIBTOOLIZE}" ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then
|
|
LIBTOOLIZE="${GLIBTOOLIZE}"
|
|
export LIBTOOLIZE
|
|
fi
|
|
command -v autoreconf >/dev/null || \
|
|
(echo "configuration failed, please install autoconf first" && exit 1)
|
|
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
|