diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-11-13 23:35:48 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-11-13 23:35:48 +0000 |
commit | 52b506e13ac184f49563411ec922f3a5ecf7cbc4 (patch) | |
tree | 29461dd7fa9f510f82508c2e0ae82c1e0daca715 | |
parent | 5497b07c8a1331e0322b614f55d458d2319ea3ea (diff) | |
download | irssi-52b506e13ac184f49563411ec922f3a5ecf7cbc4.zip |
Move irssi-version.h generation out of configure and add suport for getting the
date of the last change with svn info/git log.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4906 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | Makefile.am | 9 | ||||
-rwxr-xr-x | autogen.sh | 1 | ||||
-rw-r--r-- | configure.in | 9 | ||||
-rw-r--r-- | irssi-version.h.in | 3 | ||||
-rwxr-xr-x | irssi-version.sh | 13 |
5 files changed, 19 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am index 0fb81386..cbe147be 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,12 +1,16 @@ ACLOCAL_AMFLAGS = -I . # create default-config.h -BUILT_SOURCES = default-config.h default-theme.h +BUILT_SOURCES = default-config.h default-theme.h irssi-version.h + +.PHONY: irssi-version.h default-config.h: $(srcdir)/irssi.conf $(srcdir)/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h default-theme.h: $(srcdir)/default.theme $(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h +irssi-version.h: + $(srcdir)/irssi-version.sh $(srcdir) > $@ SUBDIRS = src docs scripts @@ -18,8 +22,6 @@ theme_DATA = default.theme colorless.theme pkginclude_HEADERS = irssi-config.h irssi-version.h -noinst_HEADERS = irssi-version.h.in - EXTRA_DIST = \ ChangeLog \ autogen.sh \ @@ -30,4 +32,5 @@ EXTRA_DIST = \ $(theme_DATA) \ irssi-config.in \ irssi-icon.png \ + irssi-version.sh \ syntax.pl @@ -27,7 +27,6 @@ echo "Creating help files..." perl syntax.pl $srcdir/update-changelog.sh $srcdir -test -f $srcdir/ChangeLog || exit 1 files=`echo docs/help/in/*.in|sed -e 's,docs/help/in/Makefile.in ,,' -e 's,docs/help/in/,!,g' -e 's/\.in /.in ?/g'` cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am diff --git a/configure.in b/configure.in index 9c39a67c..d10d2c1d 100644 --- a/configure.in +++ b/configure.in @@ -698,14 +698,6 @@ if test "x$want_ipv6" = "xyes"; then AC_MSG_RESULT($have_ipv6) fi -dnl ** -dnl ** IRSSI_VERSION_DATE and IRSSI_VERSION_TIME -dnl ** -VERSION_DATE=`head -n 2 $srcdir/ChangeLog| grep '^r' | awk '{print $5}' | tr -d '-'` -VERSION_TIME=`head -n 2 $srcdir/ChangeLog| grep '^r' | awk '{print $6}' | awk -F: '{printf "%d\n", $1$2}'` -AC_SUBST(VERSION_DATE) -AC_SUBST(VERSION_TIME) - AC_CONFIG_FILES([ Makefile src/Makefile @@ -734,7 +726,6 @@ scripts/examples/Makefile docs/Makefile docs/help/Makefile docs/help/in/Makefile -irssi-version.h irssi-config ]) diff --git a/irssi-version.h.in b/irssi-version.h.in deleted file mode 100644 index 82c80559..00000000 --- a/irssi-version.h.in +++ /dev/null @@ -1,3 +0,0 @@ -/* automatically created by configure */ -#define IRSSI_VERSION_DATE @VERSION_DATE@ -#define IRSSI_VERSION_TIME @VERSION_TIME@ diff --git a/irssi-version.sh b/irssi-version.sh new file mode 100755 index 00000000..c808e8a6 --- /dev/null +++ b/irssi-version.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +if test -d "$1"/.svn ; then + DATE=`LC_ALL=C svn info "$1" | sed -n 's/^Last Changed Date: \(.*\)/\1/p'` +elif test -d "$1"/.git ; then + DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD` +else + DATE=`awk -F '|' 'NR == 2{print substr($3, 2)}' "$1"/ChangeLog` +fi +VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -` +VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F : '{print $1 $2}'` +echo "#define IRSSI_VERSION_DATE $VERSION_DATE" +echo "#define IRSSI_VERSION_TIME $VERSION_TIME" |