Skip to content
  • Michał Kępień's avatar
    Revise "srcid" file handling · ed212e9c
    Michał Kępień authored
    The "srcid" file present in each BIND source tarball contains a
    shortened hash of the Git commit corresponding to a given BIND release.
    This allows a Git reference to be included in an archive that otherwise
    lacks any Git information.
    
    Before the move to Automake, if an "srcid" file was present in the root
    source directory at the time ./configure was run, its contents were used
    as the value of a compile-time constant which was then baked into BIND
    binaries; otherwise, "git rev-parse" was used to determine the value of
    that constant.
    
    With Automake, a similar approach was attempted that required the
    "srcid" file to be present at autoreconf time in order for it to be
    used.  However, note that this means that even if that file is present
    in a source tarball created using "make dist", its contents are not
    going to influence the value of the aforementioned compile-time constant
    because autoreconf hardcodes the output of "git rev-parse" into the
    configure script at autoreconf time.
    
    To make things more clear, always use "git rev-parse" for determining
    the value of the PACKAGE_SRCID compile-time constant when running
    autoreconf.  This causes "srcid" to be an empty string in source
    tarballs built from other source tarballs, but that is not deemed to be
    much of an issue as "make dist" is expected to be run from Git
    repository clones.  Remove stderr redirections to /dev/null to ensure
    errors caused e.g. by running "make dist" from outside a Git repository
    clone are not hidden.  Trim the Git commit hash to 7 characters for
    consistency between Unix and Windows systems.
    
    Despite the above, ensure the "srcid" file is present in source tarballs
    created using "make dist" as that file is used by the build process on
    Windows.
    ed212e9c