diff --git a/configure.ac b/configure.ac index ff342ca06..62ef9f8b3 100644 --- a/configure.ac +++ b/configure.ac @@ -5,12 +5,14 @@ dnl "0" for stable, supported releases dnl these should be the only two lines you need to change m4_define([user_agent_prefix],[1.61+]) m4_define([peer_id_prefix],[-TR161Z-]) +m4_define([svn_revision], esyscmd([sh -c "svnversion | sed -r 's/([0-9]+).*/\1/'"])) AC_INIT([transmission], [user_agent_prefix], [http://trac.transmissionbt.com/newticket]) AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix]) AC_SUBST(PEERID_PREFIX,[peer_id_prefix]) +AC_SUBST(SVN_REVISION,[svn_revision]) AC_CONFIG_MACRO_DIR([m4]) @@ -352,6 +354,7 @@ AC_CONFIG_FILES([Makefile daemon/Makefile doc/Makefile libtransmission/Makefile + libtransmission/version.h third-party/Makefile third-party/miniupnp/Makefile third-party/libnatpmp/Makefile diff --git a/libtransmission/Makefile.am b/libtransmission/Makefile.am index 5b2ac490c..47edacde5 100644 --- a/libtransmission/Makefile.am +++ b/libtransmission/Makefile.am @@ -102,6 +102,7 @@ noinst_HEADERS = \ upnp.h \ utils.h \ verify.h \ + version.h \ web.h \ webseed.h @@ -169,22 +170,3 @@ peer_msgs_test_LDFLAGS = ${apps_ldflags} utils_test_SOURCES = utils-test.c utils_test_LDADD = ${apps_ldadd} utils_test_LDFLAGS = ${apps_ldflags} - - - -clean-local: - if test -d .svn; then if test -e version.h; then rm version.h; fi; fi; - -EXTRA_libtransmission_a_SOURCES = \ - version.h - -BUILT_SOURCES = \ - version.h - -version.h: - echo '#define PEERID_PREFIX "'@PEERID_PREFIX@'"' > version.h - echo '#define USERAGENT_PREFIX "'@USERAGENT_PREFIX@'"' >> version.h - echo '#define SVN_REVISION "'`svnversion | sed -r 's/([0-9]+).*/\1/'`'"' >> version.h - echo '#define SVN_REVISION_NUM '`svnversion | sed -r 's/([0-9]+).*/\1/'`'' >> version.h - echo '#define SHORT_VERSION_STRING "'@USERAGENT_PREFIX@'"' >> version.h - echo '#define LONG_VERSION_STRING "'@USERAGENT_PREFIX@' ('`svnversion | sed -r 's/([0-9]+).*/\1/'`')"' >> version.h diff --git a/libtransmission/version.h.in b/libtransmission/version.h.in new file mode 100644 index 000000000..5c6681bc7 --- /dev/null +++ b/libtransmission/version.h.in @@ -0,0 +1,12 @@ +#define PEERID_PREFIX "@PEERID_PREFIX@'" +#define USERAGENT_PREFIX "@USERAGENT_PREFIX@'" +#define SVN_REVISION "@SVN_REVISION@" +#define SVN_REVISION_NUM @SVN_REVISION@ +#define SHORT_VERSION_STRING "@USERAGENT_PREFIX@" +#define LONG_VERSION_STRING "@USERAGENT_PREFIX@ (@SVN_REVISION@)" +#define PEERID_PREFIX "@PEERID_PREFIX@'" +#define USERAGENT_PREFIX "@USERAGENT_PREFIX@'" +#define SVN_REVISION "@SVN_REVISION@" +#define SVN_REVISION_NUM @SVN_REVISION@ +#define SHORT_VERSION_STRING "@USERAGENT_PREFIX@" +#define LONG_VERSION_STRING "@USERAGENT_PREFIX@ (@SVN_REVISION@)"