diff options
author | Johnathan Corgan | 2010-06-02 08:47:13 -0700 |
---|---|---|
committer | Johnathan Corgan | 2010-06-02 08:47:13 -0700 |
commit | 35940091f03b80c2611bcbeca0da343a4371f7c1 (patch) | |
tree | cdfab5963afcde7068591db2799ad0a467ed1335 /gr-howto-write-a-block/config/gr_git.m4 | |
parent | 1badda02acc4d67409c29447ba20c51d2849bd9e (diff) | |
download | gnuradio-35940091f03b80c2611bcbeca0da343a4371f7c1.tar.gz gnuradio-35940091f03b80c2611bcbeca0da343a4371f7c1.tar.bz2 gnuradio-35940091f03b80c2611bcbeca0da343a4371f7c1.zip |
build: redo GR_GIT for portability
Diffstat (limited to 'gr-howto-write-a-block/config/gr_git.m4')
-rw-r--r-- | gr-howto-write-a-block/config/gr_git.m4 | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gr-howto-write-a-block/config/gr_git.m4 b/gr-howto-write-a-block/config/gr_git.m4 index 5e8aa663b..c4f1ea0c0 100644 --- a/gr-howto-write-a-block/config/gr_git.m4 +++ b/gr-howto-write-a-block/config/gr_git.m4 @@ -30,18 +30,23 @@ AC_DEFUN([GR_GIT],[ AC_MSG_CHECKING([git description of current commit]) if (cd $srcdir && $GIT describe >/dev/null 2>&1); then GIT_DESCRIBE=`cd $srcdir && $GIT describe --abbrev=8 --long` - GIT_TAG=`echo $GIT_DESCRIBE | cut -f 1 -d '-'` - GIT_SEQNO=`echo $GIT_DESCRIBE | cut -f 2 -d '-'` - GIT_COMMIT=`echo $GIT_DESCRIBE | cut -f 3 -d '-' | cut -f 2- -d 'g'` # Release candidate tags create an extra -rcX field - if test x`echo $GIT_DESCRIBE | cut -f 1- -d '-' --output-delimiter=' ' | wc -w` = x4; then - GIT_TAG=`echo $GIT_DESCRIBE | cut -f -2 -d '-'` - GIT_SEQNO=`echo $GIT_DESCRIBE | cut -f 3 -d '-'` - GIT_COMMIT=`echo $GIT_DESCRIBE | cut -f 4 -d '-' | cut -f 2- -d 'g'` - fi + case $GIT_DESCRIBE in + *-*-*-*) + GIT_TAG=`echo $GIT_DESCRIBE | cut -f -2 -d '-'` + GIT_SEQNO=`echo $GIT_DESCRIBE | cut -f 3 -d '-'` + GIT_COMMIT=`echo $GIT_DESCRIBE | cut -f 4 -d '-' | cut -f 2- -d 'g'` + ;; + *-*-*) + GIT_TAG=`echo $GIT_DESCRIBE | cut -f 1 -d '-'` + GIT_SEQNO=`echo $GIT_DESCRIBE | cut -f 2 -d '-'` + GIT_COMMIT=`echo $GIT_DESCRIBE | cut -f 3 -d '-' | cut -f 2- -d 'g'` + ;; + esac + AC_MSG_RESULT([$GIT_DESCRIBE]) else - AC_MSG_RESULT([unable to find, using current commit]) + AC_MSG_RESULT([no tag in history, using current commit]) GIT_TAG='' GIT_SEQNO='' GIT_COMMIT=`cd $srcdir && $GIT describe --always --abbrev=8` |