X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/1cfe6375ce4302e7252d4eb5910a400f292ad1f2..e8cd1ad655bcc704b06fb2f191dc3ac1df32b796:/bootstrap?ds=sidebyside diff --git a/bootstrap b/bootstrap index 9923ff04..0c136f62 100755 --- a/bootstrap +++ b/bootstrap @@ -144,9 +144,9 @@ vc_ignore=auto # ------------------------- find_tool () { - # Find sha1sum, named gsha1sum on MacPorts. find_tool_envvar=$1 shift + find_tool_name=$@ if eval test x"\$$find_tool_envvar" = x; then for i do @@ -157,7 +157,7 @@ find_tool () done fi if test x"$find_tool_res" = x; then - echo >&2 "$0: $find_tool_name is required" + echo >&2 "$0: one of these is required: $find_tool_names" exit 1 fi ($find_tool_res --version /dev/null 2>&1 || { @@ -211,7 +211,7 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then exit 1 fi -# If $STR is not already on a line by itself in $FILE, insert it, +# If each line in $STR is not already on a line by itself in $FILE, insert it, # sorting the new contents of the file and replacing $FILE with the result. insert_sorted_if_absent() { file=$1 @@ -222,6 +222,21 @@ insert_sorted_if_absent() { || exit 1 } +# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with +# insert_sorted_if_absent. +insert_vc_ignore() { + vc_ignore_file="$1" + case $vc_ignore_file in + *.gitignore) + # A .gitignore entry that does not start with `/' applies recursively to + # subdirectories, so prepend `/' to every .gitignore entry. + pattern=`echo "$2" | sed s,^,/,`;; + *) + pattern="$2";; + esac + insert_sorted_if_absent "$vc_ignore_file" "$pattern" +} + # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac. found_aux_dir=no grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \ @@ -240,7 +255,7 @@ if test ! -d $build_aux; then mkdir $build_aux for dot_ig in x $vc_ignore; do test $dot_ig = x && continue - insert_sorted_if_absent $dot_ig $build_aux + insert_vc_ignore $dot_ig $build_aux done fi @@ -252,6 +267,20 @@ cleanup_gnulib() { exit $status } +# See if we can use gnulib's git-merge-changelog merge driver. + +if test -d .git && (git --version) >/dev/null 2>/dev/null ; then + if git config merge.merge-changelog.driver >/dev/null ; then + : + elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then + echo "initializing git-merge-changelog driver" + git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + echo "consider installing git-merge-changelog from gnulib" + fi +fi + # Get gnulib files. case ${GNULIB_SRCDIR--} in @@ -350,7 +379,7 @@ check_dst_dir() for dot_ig in x $vc_ignore; do test $dot_ig = x && continue ig=$parent/$dot_ig - insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'` + insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'` done fi } @@ -476,11 +505,10 @@ slurp() { if test $file = Makefile.am; then copied=$copied${sep}$gnulib_mk; sep=$nl remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" - sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || { - echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." && - rm -f $dir/$gnulib_mk && - sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk - } + echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." + rm -f $dir/$gnulib_mk + sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk + etc/prefix-gnulib-mk $dir/$gnulib_mk elif { test "${2+set}" = set && test -r $2/$dir/$file; } || version_controlled_file $dir $file; then echo "$0: $dir/$file overrides $1/$dir/$file" @@ -507,18 +535,18 @@ slurp() { test $dot_ig = x && continue ig=$dir/$dot_ig if test -n "$copied"; then - insert_sorted_if_absent $ig "$copied" + insert_vc_ignore $ig "$copied" # If an ignored file name ends with _.h, then also add # the name with just ".h". Many gnulib headers are generated, # e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc. # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed f=`echo "$copied"|sed 's/_\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'` - insert_sorted_if_absent $ig "$f" + insert_vc_ignore $ig "$f" # For files like sys_stat_.h and sys_time_.h, record as # ignorable the directory we might eventually create: sys/. f=`echo "$copied"|sed 's/sys_.*_\.h$/sys/'` - insert_sorted_if_absent $ig "$f" + insert_vc_ignore $ig "$f" fi done done