summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block
diff options
context:
space:
mode:
authorJohnathan Corgan2010-05-30 23:06:20 -0700
committerJohnathan Corgan2010-05-30 23:06:20 -0700
commitb98cabac11306fa25c29a2e0adc1c0c0a697e9a0 (patch)
tree8745c05b9cf4b83f64931e896a4f22fbe602ebbc /gr-howto-write-a-block
parentad13c00ae8cba6327851652a7d0c94a6d6316916 (diff)
downloadgnuradio-b98cabac11306fa25c29a2e0adc1c0c0a697e9a0.tar.gz
gnuradio-b98cabac11306fa25c29a2e0adc1c0c0a697e9a0.tar.bz2
gnuradio-b98cabac11306fa25c29a2e0adc1c0c0a697e9a0.zip
howto: make versioned libraries
Diffstat (limited to 'gr-howto-write-a-block')
-rw-r--r--gr-howto-write-a-block/Makefile.common3
-rw-r--r--gr-howto-write-a-block/config/gr_git.m435
-rw-r--r--gr-howto-write-a-block/config/gr_version.m434
-rw-r--r--gr-howto-write-a-block/lib/Makefile.am3
4 files changed, 52 insertions, 23 deletions
diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common
index e628d6b16..8423671a3 100644
--- a/gr-howto-write-a-block/Makefile.common
+++ b/gr-howto-write-a-block/Makefile.common
@@ -27,6 +27,9 @@ modname = howto
# when going in to non-SWIG libraries
AM_CXXFLAGS = @autoconf_default_CXXFLAGS@
+# Sets ABI version in SONAME and appends -LIBVER to filename
+LTVERSIONFLAGS = -version-info 0:0:0 -release $(LIBVER)
+
# these flags are used when compiling any CXX file
AM_CPPFLAGS = \
$(STD_DEFINES_AND_INCLUDES) \
diff --git a/gr-howto-write-a-block/config/gr_git.m4 b/gr-howto-write-a-block/config/gr_git.m4
index 5fe424808..5e8aa663b 100644
--- a/gr-howto-write-a-block/config/gr_git.m4
+++ b/gr-howto-write-a-block/config/gr_git.m4
@@ -1,4 +1,4 @@
-dnl Copyright 2009 Free Software Foundation, Inc.
+dnl Copyright 2009,2010 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -24,12 +24,35 @@ AC_DEFUN([GR_GIT],[
dnl If it exists, get either 'git describe' or fallback to current commit
if test x$GIT != x ; then
- if (cd $srcdir && $GIT describe >/dev/null 2>&1); then
- GIT_VERSION=`cd $srcdir && $GIT describe --abbrev=8 | cut -f 2- -d '-'`
- else
- if (cd $srcdir && $GIT describe --always --abbrev=8 >/dev/null 2>&1); then
- GIT_VERSION=`cd $srcdir && $GIT describe --always --abbrev=8`
+ AC_MSG_CHECKING([existence of git version control directory])
+ if test -d $srcdir/.git ; then
+ AC_MSG_RESULT([ok])
+ 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
+ AC_MSG_RESULT([$GIT_DESCRIBE])
+ else
+ AC_MSG_RESULT([unable to find, using current commit])
+ GIT_TAG=''
+ GIT_SEQNO=''
+ GIT_COMMIT=`cd $srcdir && $GIT describe --always --abbrev=8`
fi
+ else
+ AC_MSG_RESULT([not found])
fi
+
+ AC_SUBST([GIT_DESCRIBE])
+ AC_SUBST([GIT_TAG])
+ AC_SUBST([GIT_SEQNO])
+ AC_SUBST([GIT_COMMIT])
fi
])
diff --git a/gr-howto-write-a-block/config/gr_version.m4 b/gr-howto-write-a-block/config/gr_version.m4
index 489f78034..a7a202238 100644
--- a/gr-howto-write-a-block/config/gr_version.m4
+++ b/gr-howto-write-a-block/config/gr_version.m4
@@ -1,4 +1,4 @@
-dnl Copyright 2009 Free Software Foundation, Inc.
+dnl Copyright 2009,2010 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -31,39 +31,43 @@ AC_DEFUN([GR_VERSION],[
dnl The last two fields can have 'git' instead of a number to indicate
dnl that this branch is between versions.
. $srcdir/version.sh
- RELEASE=$MAJOR_VERSION.$API_COMPAT
dnl Get git version if available
GR_GIT
dnl Test if we should use git version
if test "$MINOR_VERSION" == "git"; then
- dnl 3.3git-xxx-gxxxxxxxx
- RELEASE=$RELEASE$MINOR_VERSION
- DOCVER=$RELEASE
- if test "$GIT_VERSION" != "" ; then
- RELEASE=$RELEASE-$GIT_VERSION
- fi
+ dnl RELEASE: 3.3git-xxx-gxxxxxxxx
+ dnl DOCVER: 3.3git
+ dnl LIBVER: 3.3git
+ RELEASE=$GIT_DESCRIBE
+ DOCVER=$MAJOR_VERSION.$API_COMPAT$MINOR_VERSION
+ LIBVER=$MAJOR_VERSION.$API_COMPAT$MINOR_VERSION
else
if test "$MAINT_VERSION" == "git" ; then
- dnl 3.3.1git-xxx-gxxxxxxxx
- RELEASE=$RELEASE.$MINOR_VERSION$MAINT_VERSION
- DOCVER=$RELEASE
- if test "$GIT_VERSION" != "" ; then
- RELEASE=$RELEASE-$GIT_VERSION
- fi
+ dnl RELEASE: 3.3.1git-xxx-gxxxxxxxx
+ dnl DOCVER: 3.3.1git
+ dnl LIBVER: 3.3.1git
+ RELEASE=$GIT_DESCRIBE
+ DOCVER=$MAJOR_VERSION.$API_COMPAT.$MINOR_VERSION$MAINT_VERSION
+ LIBVER=$MAJOR_VERSION.$API_COMPAT.$MINOR_VERSION$MAINT_VERSION
else
dnl This is a numbered release.
- RELEASE=$RELEASE.$MINOR_VERSION
+ dnl RELEASE: 3.3.1{.x}
+ dnl DOCVER: 3.3.1{.x}
+ dnl LIBVER: 3.3.1{.x}
+ RELEASE=$MAJOR_VERSION.$API_COMPAT.$MINOR_VERSION
if test "$MAINT_VERSION" != "0"; then
RELEASE=$RELEASE.$MAINT_VERSION
fi
DOCVER=$RELEASE
+ LIBVER=$RELEASE
fi
fi
AC_MSG_NOTICE([GNU Radio Release $RELEASE])
AC_SUBST(RELEASE)
AC_SUBST(DOCVER)
+ AC_SUBST(LIBVER)
])
diff --git a/gr-howto-write-a-block/lib/Makefile.am b/gr-howto-write-a-block/lib/Makefile.am
index 2e76ee453..f0a18358f 100644
--- a/gr-howto-write-a-block/lib/Makefile.am
+++ b/gr-howto-write-a-block/lib/Makefile.am
@@ -42,8 +42,7 @@ libgnuradio_howto_la_SOURCES = \
libgnuradio_howto_la_LIBADD = \
$(GNURADIO_CORE_LA)
-libgnuradio_howto_la_LDFLAGS = \
- $(NO_UNDEFINED)
+libgnuradio_howto_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
# ----------------------------------------------------------------
# howto C++ QA library: libgnuradio-howto-qa.so (not installed)