X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fbootstrap;h=8f14199959646ba998bf9d6f464c11143764acae;hb=3e08d3f9b9b5920385529d4a981f052bbcc0a5a7;hp=df9549c63b05f40e9666fe4de816462a43a7edfa;hpb=454aac9c51a1b0acd30b80adad9d2e449b321ce5;p=gnulib.git diff --git a/build-aux/bootstrap b/build-aux/bootstrap index df9549c63..8f1419995 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -34,7 +34,7 @@ bt_regex=`echo "$bt"| sed 's/\./[.]/g'` bt2=${bt}2 usage() { - echo >&2 "\ + cat </dev/null 2>&1; then + find_tool_res=$i + break + fi + done + else + find_tool_error_prefix="\$$find_tool_envvar: " + fi + if test x"$find_tool_res" = x; then + echo >&2 "$0: one of these is required: $find_tool_names" + exit 1 + fi + ($find_tool_res --version /dev/null 2>&1 || { + echo >&2 "$0: ${find_tool_error_prefix}cannot run $find_tool_res --version" + exit 1 + } + eval "$find_tool_envvar=\$find_tool_res" + eval "export $find_tool_envvar" +} + +# Find sha1sum, named gsha1sum on MacPorts. +find_tool SHA1SUM sha1sum gsha1sum + # Override the default configuration, if necessary. # Make sure that bootstrap.conf is sourced from the current directory # if we were invoked as "sh bootstrap". @@ -272,10 +311,10 @@ get_version() { $app --version 2>&1 | sed -n 's/[^0-9.]*\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/p - t done - d - :done - q' + t done + d + :done + q' } check_versions() { @@ -313,7 +352,7 @@ print_versions() { if ! printf "$buildreq" | check_versions; then test -f README-prereq && - echo "Please see README-prereq for notes on obtaining these prerequisite programs:" >&2 + echo "See README-prereq for notes on obtaining these prerequisite programs:" >&2 echo print_versions exit 1 @@ -371,7 +410,7 @@ case ${GNULIB_SRCDIR--} in # Redirect the gnulib submodule to the directory on the command line # if possible. if test -d "$GNULIB_SRCDIR"/.git && \ - git_modules_config submodule.gnulib.url >/dev/null; then + git_modules_config submodule.gnulib.url >/dev/null; then git submodule init GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd` git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR @@ -419,10 +458,12 @@ update_po_files() { new_po="$ref_po_dir/$po.po" cksum_file="$ref_po_dir/$po.s1" if ! test -f "$cksum_file" || - ! test -f "$po_dir/$po.po" || - ! ${SHA1SUM-sha1sum} -c --status "$cksum_file" < "$new_po" > /dev/null; then + ! test -f "$po_dir/$po.po" || + ! $SHA1SUM -c --status "$cksum_file" \ + < "$new_po" > /dev/null; then echo "updated $po_dir/$po.po..." - cp "$new_po" "$po_dir/$po.po" && ${SHA1SUM-sha1sum} < "$new_po" > "$cksum_file" + cp "$new_po" "$po_dir/$po.po" \ + && $SHA1SUM < "$new_po" > "$cksum_file" fi done } @@ -456,45 +497,45 @@ symlink_to_dir() # FIXME: for now, this does only one level parent=`dirname "$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,.*/,,'` + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'` done fi if $copy; then { - test ! -h "$dst" || { - echo "$0: rm -f $dst" && - rm -f "$dst" - } + test ! -h "$dst" || { + echo "$0: rm -f $dst" && + rm -f "$dst" + } } && test -f "$dst" && cmp -s "$src" "$dst" || { - echo "$0: cp -fp $src $dst" && - cp -fp "$src" "$dst" + echo "$0: cp -fp $src $dst" && + cp -fp "$src" "$dst" } else test -h "$dst" && src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 && dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 && test "$src_i" = "$dst_i" || { - dot_dots= - case $src in - /*) ;; - *) - case /$dst/ in - *//* | */../* | */./* | /*/*/*/*/*/) - echo >&2 "$0: invalid symlink calculation: $src -> $dst" - exit 1;; - /*/*/*/*/) dot_dots=../../../;; - /*/*/*/) dot_dots=../../;; - /*/*/) dot_dots=../;; - esac;; - esac - - echo "$0: ln -fs $dot_dots$src $dst" && - ln -fs "$dot_dots$src" "$dst" + dot_dots= + case $src in + /*) ;; + *) + case /$dst/ in + *//* | */../* | */./* | /*/*/*/*/*/) + echo >&2 "$0: invalid symlink calculation: $src -> $dst" + exit 1;; + /*/*/*/*/) dot_dots=../../../;; + /*/*/*/) dot_dots=../../;; + /*/*/) dot_dots=../;; + esac;; + esac + + echo "$0: ln -fs $dot_dots$src $dst" && + ln -fs "$dot_dots$src" "$dst" } fi } @@ -524,28 +565,28 @@ cp_mark_as_generated() if test -z "$c1"; then cmp -s "$cp_src" "$cp_dst" || { - # Copy the file first to get proper permissions if it - # doesn't already exist. Then overwrite the copy. - echo "$0: cp -f $cp_src $cp_dst" && - rm -f "$cp_dst" && - cp "$cp_src" "$cp_dst-t" && - sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" && - mv -f "$cp_dst-t" "$cp_dst" + # Copy the file first to get proper permissions if it + # doesn't already exist. Then overwrite the copy. + echo "$0: cp -f $cp_src $cp_dst" && + rm -f "$cp_dst" && + cp "$cp_src" "$cp_dst-t" && + sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" && + mv -f "$cp_dst-t" "$cp_dst" } else # Copy the file first to get proper permissions if it # doesn't already exist. Then overwrite the copy. cp "$cp_src" "$cp_dst-t" && ( - echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" && - echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" && - sed "s!$bt_regex/!!g" "$cp_src" + echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" && + echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" && + sed "s!$bt_regex/!!g" "$cp_src" ) > $cp_dst-t && if cmp -s "$cp_dst-t" "$cp_dst"; then - rm -f "$cp_dst-t" + rm -f "$cp_dst-t" else - echo "$0: cp $cp_src $cp_dst # with edits" && - mv -f "$cp_dst-t" "$cp_dst" + echo "$0: cp $cp_src $cp_dst # with edits" && + mv -f "$cp_dst-t" "$cp_dst" fi fi fi @@ -557,7 +598,7 @@ version_controlled_file() { found=no if test -d CVS; then grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | - grep '^/[^/]*/[0-9]' > /dev/null && found=yes + grep '^/[^/]*/[0-9]' > /dev/null && found=yes elif test -d .git; then git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes elif test -d .svn; then @@ -579,35 +620,35 @@ slurp() { esac test -d $1/$dir/$file && continue for excluded_file in $excluded_files; do - test "$dir/$file" = "$excluded_file" && continue 2 + test "$dir/$file" = "$excluded_file" && continue 2 done if test $file = Makefile.am; then copied=$copied${sep}$gnulib_mk; sep=$nl - remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" + remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || { - 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 + } elif { test "${2+set}" = set && test -r $2/$dir/$file; } || - version_controlled_file $dir $file; then - echo "$0: $dir/$file overrides $1/$dir/$file" + version_controlled_file $dir $file; then + echo "$0: $dir/$file overrides $1/$dir/$file" else - copied=$copied$sep$file; sep=$nl - if test $file = gettext.m4; then - echo "$0: patching m4/gettext.m4 to remove need for intl/* ..." - rm -f $dir/$file - sed ' - /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\ - AC_DEFUN([AM_INTL_SUBDIR], [ - /^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\ - AC_DEFUN([gt_INTL_SUBDIR_CORE], []) - $a\ - AC_DEFUN([gl_LOCK_EARLY], []) - ' $1/$dir/$file >$dir/$file - else - cp_mark_as_generated $1/$dir/$file $dir/$file - fi + copied=$copied$sep$file; sep=$nl + if test $file = gettext.m4; then + echo "$0: patching m4/gettext.m4 to remove need for intl/* ..." + rm -f $dir/$file + sed ' + /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\ + AC_DEFUN([AM_INTL_SUBDIR], [ + /^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\ + AC_DEFUN([gt_INTL_SUBDIR_CORE], []) + $a\ + AC_DEFUN([gl_LOCK_EARLY], []) + ' $1/$dir/$file >$dir/$file + else + cp_mark_as_generated $1/$dir/$file $dir/$file + fi fi || exit done @@ -615,18 +656,18 @@ slurp() { test $dot_ig = x && continue ig=$dir/$dot_ig if test -n "$copied"; then - insert_sorted_if_absent $ig "$copied" - # If an ignored file name ends with .in.h, then also add - # the name with just ".h". Many gnulib headers are generated, - # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc. - # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed - f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'` - insert_sorted_if_absent $ig "$f" - - # For files like sys_stat.in.h and sys_time.in.h, record as - # ignorable the directory we might eventually create: sys/. - f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'` - insert_sorted_if_absent $ig "$f" + insert_sorted_if_absent $ig "$copied" + # If an ignored file name ends with .in.h, then also add + # the name with just ".h". Many gnulib headers are generated, + # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc. + # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed + f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'` + insert_sorted_if_absent $ig "$f" + + # For files like sys_stat.in.h and sys_time.in.h, record as + # ignorable the directory we might eventually create: sys/. + f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'` + insert_sorted_if_absent $ig "$f" fi done done @@ -687,6 +728,10 @@ find "$m4_base" "$source_base" \ # Reconfigure, getting other files. +# Skip autoheader if it's not needed. +grep '^[ ]*AC_CONFIG_HEADERS\>' configure.ac >/dev/null || + AUTOHEADER=true + for command in \ libtool \ "${ACLOCAL-aclocal} --force -I m4" \ @@ -732,7 +777,7 @@ if test $with_gettext = yes; then /^XGETTEXT_OPTIONS *=/{ s/$/ \\/ a\ - '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} + '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} } ' po/Makevars.template >po/Makevars @@ -744,9 +789,9 @@ if test $with_gettext = yes; then /^subdir *=.*/s/=.*/= runtime-po/ /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ /^XGETTEXT_OPTIONS *=/{ - s/$/ \\/ - a\ - '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} + s/$/ \\/ + a\ + '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} } ' runtime-po/Makevars @@ -756,3 +801,7 @@ if test $with_gettext = yes; then fi echo "$0: done. Now you can run './configure'." + +# Local Variables: +# indent-tabs-mode: nil +# End: