GIT-VERSION-GEN: Recognize git version in gitweb snapshots. gitweb prepends the repo name and the git version number to all paths of the snapshot tarballs (example: paraslash-32a81d7/). This commit teaches GIT-VERSION-GEN to make use of this information. The patched script reports the git version thusly encoded in the current directory, rather than resort to "unnamed_version" as before.
GIT-VERSION-GEN: Don't include output of git update-index. GIT-VERSION-GEN calls git update-index which might write something like "configure.ac: Needs update" to stdout. We don't want this text to be part of the version string, so make sure we discard the output of git update-index.
doxify version.h and git-version.h.
Fix git-version file creation. ATM, this does not work well, since only the executables depend on GIT-VERSION-FILE, but relinking these does not take into account the new contents of GIT-VERSION-FILE. Hence a "make clean" is necessary to produce executables that reports the correct version number. This patch changes GIT-VERSION-GEN so that it generates a preprocessor define instead of setting a Makefile variable. This value is written to stdout in any case and also to the file named "$1" if an argument was given and the current git version differs from the contents of this file (or if the file does not exist). In order to not have to recompile everything on version changes, the macros related to versioning are moved from para.h into the new version.h file which is included only where necessary. Makefile.in no longer uses phony targets to include the GIT_VERSION variable. Instead we simply execute $(shell ./GIT_VERSION_FILE version.h) at the top of the Makefile.
Put the git version into all executables. This patch changes the -V output of all executables to print also the git version which was used to make the executable. The idea and the GIT-VERSION_GEN script was taken from git.git. It also adds a VERSION file to the generated tarball. If this file exists, its content is used as the version info rather than calling git to obtain this info. This way, even if paraslash is built from a tarball, the executables still contain the git version the tarball was generated from.