From c0f9d4b0f1e4d1d49d238e4b2546de46f51166eb Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 10 Apr 2008 13:09:19 -0400 Subject: PR6393: git version tagging at build time 2008-04-10 Frank Ch. Eigler PR 6393. * git_version.sh: New file, copied from radeonhd. * configure.ac: No longer generate $builddir/SNAPSHOT. * Makefile.am: Generate $builddir/git_version.h. (EXTRA_DIST): Add git_version.h and git_version.sh. * main.cxx (version): Print generated GIT_MESSAGE therefrom. * Makefile.in, configure: Regenerated. --- git_version.sh | 348 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100755 git_version.sh (limited to 'git_version.sh') diff --git a/git_version.sh b/git_version.sh new file mode 100755 index 00000000..69eb0f24 --- /dev/null +++ b/git_version.sh @@ -0,0 +1,348 @@ +#!/bin/sh +# +# Generate some basic versioning information which can be piped to a header. +# +# Copyright (c) 2006-2007 Luc Verhaegen +# Copyright (C) 2007 Hans Ulrich Niedermann +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# This script is based on the one written for xf86-video-unichrome by +# Luc Verhaegen, but was rewritten almost completely by Hans Ulrich +# Niedermann. The script contains a few bug fixes from Egbert Eich, +# Matthias Hopf, Joerg Sonnenberger, and possibly others. +# +# The author thanks the nice people on #git for the assistance. +# +# Simple testing of this script: +# /sbin/busybox sh git_version.sh --example > moo.c \ +# && gcc -Wall -Wextra -Wno-unused -o moo moo.c \ +# && ./moo +# (bash should also do) +# +# For how to hook this up to your automake- and/or imake-based build +# system, best take a look at how the RadeonHD.am and/or RadeonHD.tmpl +# work in the xf86-video-radeonhd build system. For non-recursive make, +# you can probably make things a little bit simpler. +# +# KNOWN BUGS: +# * Uses hyphenated ("git-foo-bar") program names, which git upstream +# have declared deprecated. +# + +# Help messages +USAGE="[