The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/autogen.sh

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #!/bin/sh
    2 [ "${0%/*}" = "$0" ] || cd "${0%/*}" || exit
    3 
    4 # %reldir%/%canon_reldir% (%D%/%C%) only appeared in automake 1.14, but RHEL/CentOS 7 has 1.13.4
    5 # This is an (overly) simplistic preprocessor that papers around this for the duration of the generation step,
    6 # and can be removed once support for CentOS 7 is dropped
    7 automake --version | awk '{print $NF; exit}' | (
    8         IFS=. read -r AM_MAJ AM_MIN _
    9         [ "$AM_MAJ" -gt 1 ] || [ "$AM_MIN" -ge 14 ]
   10 ) || {
   11         process_root() {
   12                 root="$1"; shift
   13 
   14                 grep -q '%[CD]%' "$root/Makefile.am" || return
   15                 find "$root" -name Makefile.am "$@" | while read -r dir; do
   16                         dir="${dir%/Makefile.am}"
   17                         grep -q '%[CD]%' "$dir/Makefile.am" || continue
   18 
   19                         reldir="${dir#"$root"}"
   20                         reldir="${reldir#/}"
   21 
   22                         canon_reldir="$(printf '%s' "$reldir" | tr -C 'a-zA-Z0-9@_' '_')"
   23 
   24                         reldir_slash="$reldir/"
   25                         canon_reldir_slash="${canon_reldir}_"
   26                         [ -z "$reldir" ] && reldir_slash=
   27                         [ -z "$reldir" ] && canon_reldir_slash=
   28 
   29                         echo "$dir/Makefile.am" >&3
   30                         sed -i~ -e "s:%D%/:$reldir_slash:g"       -e "s:%D%:$reldir:g" \
   31                                 -e "s:%C%_:$canon_reldir_slash:g" -e "s:%C%:$canon_reldir:g" "$dir/Makefile.am"
   32                 done 3>>"$substituted_files"
   33         }
   34 
   35         rollback() {
   36                 while read -r f; do
   37                         mv "$f~" "$f"
   38                 done < "$substituted_files"
   39                 rm -f "$substituted_files"
   40         }
   41 
   42 
   43         echo "Automake <1.14; papering over missing %reldir%/%canon_reldir% support" >&2
   44 
   45         substituted_files="$(mktemp)"
   46         trap rollback EXIT
   47 
   48         roots="$(sed '/Makefile$/!d;/module/d;s:^\s*:./:;s:/Makefile::;/^\.$/d' configure.ac)"
   49 
   50         IFS="
   51 "
   52         for root in $roots; do
   53                 root="${root#./}"
   54                 process_root "$root"
   55         done
   56 
   57         set -f
   58         # shellcheck disable=SC2086,SC2046
   59         process_root . $(printf '!\n-path\n%s/*\n' $roots)
   60 }
   61 
   62 autoreconf -fiv && rm -rf autom4te.cache

Cache object: 043a7fc7dd90b15833321d67e20645c9


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.