https://sourceware.org/bugzilla/show_bug.cgi?id=31881

--- Comment #13 from Rostislav Krasny <rostiprodev at gmail dot com> ---
(In reply to Nick Clifton from comment #11)
> Created attachment 15616 [details]
> Proposed patch
> 
> Sorry for dropping this.
> 
> I have uploaded a revised version of your patch which:
> 
>   1. Moves the configure.ac alterations into the bfd/configure.ac
>   2. Adds support for running the configure script in a build directory
>      that is separate from the source directory (which is encouraged for
>      building the binutils).
> 
> I have tested the patch locally and it works for me, but I would like
> you to have a look over it first, before I commit it.

I can't review changes in the *.am and *.in files because I'm not familiar with
them. I saw you've added "cd $srcdir ;" before "git log". That's seems to be
right and in my original patch I missed the fact that before making a build the
configure scripts are ran from a separate directory that could be outside of
the git worktree.

The last question is: will the bfd/configure script be ran by the
src-release.sh script only or also by a user who want to build from an already
created tarball? In case of an already created tarball that part of the
bfd/configure script should not be ran because the bfd/version.h is already
created during creation of the tarball and also because there is no Git repo
available.

If the bfd/configure us always running I propose to change this line:

VERSION_DATE=$(cd $srcdir ; git log -1 --format=%cd --date=format:%Y%m%d)

into that line:

VERSION_DATE=$(cd $srcdir && git rev-parse --is-inside-work-tree > /dev/null
2>&1 && git log -1 --format=%cd --date=format:%Y%m%d)

And then generate the bfd/version.h file only if the $VERSION_DATE is not
empty.

For more information about the 'git rev-parse --is-inside-work-tree' command
read `man git-rev-parse` or https://git-scm.com/docs/git-rev-parse

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to