freebsd-src/sys/contrib/openzfs/autogen.sh
Martin Matuska bb2d13b686 zfs: merge openzfs/zfs@59493b63c (master)
Notable upstream pull request merges:
  #13782 Fix setting the large_block feature after receiving a snapshot
  #14157 FreeBSD: stop using buffer cache-only routines on sync
  #14172 zed: post a udev change event from spa_vdev_attach()
  #14181 zed: unclean disk attachment faults the vdev
  #14190 Bump checksum error counter before reporting to ZED
  #14196 Remove atomics from zh_refcount
  #14197 Don't leak packed recieved proprties
  #14198 Switch dnode stats to wmsums
  #14199 Remove few pointer dereferences in dbuf_read()
  #14200 Micro-optimize zrl_remove()
  #14204 Lua: Fix bad bitshift in lua_strx2number()
  #14212 Zstd fixes
  #14218 Avoid a null pointer dereference in zfs_mount() on FreeBSD
  #14235 nopwrites on dmu_sync-ed blocks can result in a panic
  #14236 zio can deadlock during device removal
  #14247 Micro-optimize fletcher4 calculations
  #14261 FreeBSD: zfs_register_callbacks() must implement error check
         correctly

Obtained from:	OpenZFS
OpenZFS commit:	59493b63c1
2022-12-07 14:10:46 +01:00

63 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
[ "${0%/*}" = "$0" ] || cd "${0%/*}" || exit
# %reldir%/%canon_reldir% (%D%/%C%) only appeared in automake 1.14, but RHEL/CentOS 7 has 1.13.4
# This is an (overly) simplistic preprocessor that papers around this for the duration of the generation step,
# and can be removed once support for CentOS 7 is dropped
automake --version | awk '{print $NF; exit}' | (
IFS=. read -r AM_MAJ AM_MIN _
[ "$AM_MAJ" -gt 1 ] || [ "$AM_MIN" -ge 14 ]
) || {
process_root() {
root="$1"; shift
grep -q '%[CD]%' "$root/Makefile.am" || return
find "$root" -name Makefile.am "$@" | while read -r dir; do
dir="${dir%/Makefile.am}"
grep -q '%[CD]%' "$dir/Makefile.am" || continue
reldir="${dir#"$root"}"
reldir="${reldir#/}"
canon_reldir="$(printf '%s' "$reldir" | tr -C 'a-zA-Z0-9@_' '_')"
reldir_slash="$reldir/"
canon_reldir_slash="${canon_reldir}_"
[ -z "$reldir" ] && reldir_slash=
[ -z "$reldir" ] && canon_reldir_slash=
echo "$dir/Makefile.am" >&3
sed -i~ -e "s:%D%/:$reldir_slash:g" -e "s:%D%:$reldir:g" \
-e "s:%C%_:$canon_reldir_slash:g" -e "s:%C%:$canon_reldir:g" "$dir/Makefile.am"
done 3>>"$substituted_files"
}
rollback() {
while read -r f; do
mv "$f~" "$f"
done < "$substituted_files"
rm -f "$substituted_files"
}
echo "Automake <1.14; papering over missing %reldir%/%canon_reldir% support" >&2
substituted_files="$(mktemp)"
trap rollback EXIT
roots="$(sed '/Makefile$/!d;/module/d;s:^\s*:./:;s:/Makefile::;/^\.$/d' configure.ac)"
IFS="
"
for root in $roots; do
root="${root#./}"
process_root "$root"
done
set -f
# shellcheck disable=SC2086,SC2046
process_root . $(printf '!\n-path\n%s/*\n' $roots)
}
autoreconf -fiv && rm -rf autom4te.cache