troglobit / mdnsd

Jeremie Miller's original mdnsd
BSD 3-Clause "New" or "Revised" License
55 stars 35 forks source link

Make version number available to applications #41

Closed wolframroesler closed 3 years ago

wolframroesler commented 3 years ago

Looking for a way to display the mDNS version number in application software. Could be something simple like

#define MDNSD_VERSION "0.10"

in the header file.

It'll have to be updated every time a new version is released, of course. This could be done manually (you'll need to remember) or automatically (you'd need a script to patch the header file, maybe using git describe, and run it via a CI job or commit hook or whatever).

I can implement it and submit a PR. Just let me know if the solution suggested above is OK for you.

For the record, what I actually need is a way to extract the version number from a copy of the source code, so I can check which version we've got in our code base and compare it to the latest version here on GitHub. For that purpose it'd be sufficient to put the version number into the readme file, but I think the solution suggested above would be more useful for other applications.

troglobit commented 3 years ago

This is already available in the generated config.h, created by the configure script.

wolframroesler commented 3 years ago

Found it, thanks :)

The origin (from where it goes into various files, including config.h) is configure.ac:

AC_INIT(mdnsd, 0.10, https://github.com/troglobit/mdnsd/issues)

That's where I'll take it from for my version number comparison.