mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk) #2125: Get svn revision number with autoconf rather than make
This commit is contained in:
parent
46df14ffd6
commit
2a157ca600
3 changed files with 16 additions and 19 deletions
|
@ -5,12 +5,14 @@ dnl "0" for stable, supported releases
|
||||||
dnl these should be the only two lines you need to change
|
dnl these should be the only two lines you need to change
|
||||||
m4_define([user_agent_prefix],[1.61+])
|
m4_define([user_agent_prefix],[1.61+])
|
||||||
m4_define([peer_id_prefix],[-TR161Z-])
|
m4_define([peer_id_prefix],[-TR161Z-])
|
||||||
|
m4_define([svn_revision], esyscmd([sh -c "svnversion | sed -r 's/([0-9]+).*/\1/'"]))
|
||||||
|
|
||||||
AC_INIT([transmission],
|
AC_INIT([transmission],
|
||||||
[user_agent_prefix],
|
[user_agent_prefix],
|
||||||
[http://trac.transmissionbt.com/newticket])
|
[http://trac.transmissionbt.com/newticket])
|
||||||
AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
|
AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
|
||||||
AC_SUBST(PEERID_PREFIX,[peer_id_prefix])
|
AC_SUBST(PEERID_PREFIX,[peer_id_prefix])
|
||||||
|
AC_SUBST(SVN_REVISION,[svn_revision])
|
||||||
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
|
@ -352,6 +354,7 @@ AC_CONFIG_FILES([Makefile
|
||||||
daemon/Makefile
|
daemon/Makefile
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
libtransmission/Makefile
|
libtransmission/Makefile
|
||||||
|
libtransmission/version.h
|
||||||
third-party/Makefile
|
third-party/Makefile
|
||||||
third-party/miniupnp/Makefile
|
third-party/miniupnp/Makefile
|
||||||
third-party/libnatpmp/Makefile
|
third-party/libnatpmp/Makefile
|
||||||
|
|
|
@ -102,6 +102,7 @@ noinst_HEADERS = \
|
||||||
upnp.h \
|
upnp.h \
|
||||||
utils.h \
|
utils.h \
|
||||||
verify.h \
|
verify.h \
|
||||||
|
version.h \
|
||||||
web.h \
|
web.h \
|
||||||
webseed.h
|
webseed.h
|
||||||
|
|
||||||
|
@ -169,22 +170,3 @@ peer_msgs_test_LDFLAGS = ${apps_ldflags}
|
||||||
utils_test_SOURCES = utils-test.c
|
utils_test_SOURCES = utils-test.c
|
||||||
utils_test_LDADD = ${apps_ldadd}
|
utils_test_LDADD = ${apps_ldadd}
|
||||||
utils_test_LDFLAGS = ${apps_ldflags}
|
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
|
|
||||||
|
|
12
libtransmission/version.h.in
Normal file
12
libtransmission/version.h.in
Normal file
|
@ -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@)"
|
Loading…
Reference in a new issue