bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #35580] bootstrap is not portable to OpenBSD


From: Gary V. Vaughan
Subject: Re: [bug #35580] bootstrap is not portable to OpenBSD
Date: Fri, 9 Aug 2013 10:36:42 +0700

My apologies again for harping on this…

On Aug 9, 2013, at 9:23 AM, Mike Miller <address@hidden> wrote:
> On Thu, Aug 8, 2013 at 11:08:23 +0100, Pádraig Brady wrote:
>> On 08/08/2013 03:59 AM, Mike Miller wrote:
>>> [...]
>>> You can certainly follow up with gnulib upstream if you want them to 
>>> consider
>>> using OpenBSD's sha1 instead of gsha1sum, but the bootstrap script currently
>>> uses the --status option that is GNU-specific.
>> 
>> This adjustment should avoid the need for coreutils
>> (there might be a catch 22 with that requirement).
>> You'll also need to export SHA1SUM=sha1 before running bootstrap.
>> [...]
> 
> Thanks for the suggestion. I did try SHA1SUM=sha1, but that still
> won't work with bootstrap since find_tool() requires that $tool
> understand the --version option. That was mentioned earlier in the bug
> report linked above.


For this and many other gnulib bootstrap issues that tripped up my projects,
I rewrote the script from the ground up.  You can find my version on the lua
branch of GNU Zile, all of my github projects and HEAD revisions of GNU libtool
and GNU m4, plus a bunch of other projects have adopted it over the last few
years.  My version is considerably larger, but somewhat faster, with much better
error reporting, and hugely more flexible and extensible with bootstrap.conf,
as well as fixing many of the problems with the gnulib bootstrap script that 
come
up on these lists from time to time.

I haven't actually tested it on OpenBSD, but by inspection the func_find_tool
implementation in my rewrite appears to not have this problem, trusting that a 
user
who sets an environment value for a tool knows what they are doing:

# func_find_tool ENVVAR NAMES...
# ------------------------------
# Search for a required program.  Use the value of ENVVAR, if set,
# otherwise find the first of the NAMES that can be run (i.e.,
# supports --version).  If found, set ENVVAR to the program name,
# die otherwise.
func_find_tool ()
{
    $debug_cmd

    _G_find_tool_envvar=$1
    shift
    _G_find_tool_names=$@
    eval "_G_find_tool_res=\$$_G_find_tool_envvar"
    if test -n "$_G_find_tool_res"; then
      _G_find_tool_error_prefix="\$$find_tool_envvar: "
    else
      for _G_prog
      do
        if func_tool_version_output $_G_prog >/dev/null; then
          _G_find_tool_res=$_G_prog
          break
        fi
      done
    fi
    if test -n "$_G_find_tool_res"; then
      func_tool_version_output >/dev/null $_G_find_tool_res "\
${_G_find_tool_error_prefix}Cannot run '$_G_find_tool_res --version'"

      # Make sure the result is exported to the environment for children
      # to use.
      eval "$_G_find_tool_envvar=\$_G_find_tool_res"
      eval "export $_G_find_tool_envvar"
    else
      func_error "\
One of these is required:
       $_G_find_tool_names"
    fi
}

The invocation for finding a SHA1SUM setting says:

# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6+.
func_find_tool SHA1SUM sha1sum gsha1sum shasum

I'd be delighted to hear your feedback if you have any success in switching
to my rewrite.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]