OBJDIRS+= $(sort $(dir $(BUNDLE_OBJS)))
.PRECIOUS: ${BUNDLE_SRCS}
-VERSION=$(shell support/version.sh)
-CURVERSION=$(shell cat ${BUILDDIR}/ver || echo "0")
# Common CFLAGS for all files
CFLAGS_com = -g -funsigned-char -O2
CFLAGS_com += -D_FILE_OFFSET_BITS=64
CFLAGS_com += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
-CFLAGS_com += -DHTS_VERSION=\"$(VERSION)\"
MKBUNDLE = $(CURDIR)/support/mkbundle
${CC} -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o $@ $< -ldl
clean:
- rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundles ${BUILDDIR}/ver
+ rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundles
find . -name "*~" | xargs rm -f
distclean: clean
rm -rf build.*
-ifneq ($(VERSION), $(CURVERSION))
-.PHONY: src/version.c
-$(info Version changed)
-src/version.c:
- @echo $(VERSION) >${BUILDDIR}/ver
-endif
+# Create buildversion.h
+src/version.c: $(BUILDDIR)/buildversion.h
+$(BUILDDIR)/buildversion.h: FORCE
+ @$(CURDIR)/support/version.sh $(CURDIR) $@
+FORCE:
# Include dependency files if they exist.
mk_build_segment_info(mk_mux_t *mkm)
{
htsbuf_queue_t *q = htsbuf_queue_alloc(0);
- extern char *htsversion_full;
char app[128];
- snprintf(app, sizeof(app), "HTS Tvheadend %s", htsversion_full);
+ snprintf(app, sizeof(app), "Tvheadend %s", tvheadend_version);
ebml_append_bin(q, 0x73a4, mkm->uuid, sizeof(mkm->uuid));
ebml_append_string(q, 0x7ba9, mkm->title);
- ebml_append_string(q, 0x4d80, "HTS Tvheadend Matroska muxer");
+ ebml_append_string(q, 0x4d80, "Tvheadend Matroska muxer");
ebml_append_string(q, 0x5741, app);
ebml_append_uint(q, 0x2ad7b1, MATROSKA_TIMESCALE);
#define HTSP_PRIV_MASK (ACCESS_STREAMING)
-extern const char *htsversion;
extern char *dvr_storage;
LIST_HEAD(htsp_connection_list, htsp_connection);
htsmsg_add_u32(r, "htspversion", HTSP_PROTO_VERSION);
htsmsg_add_str(r, "servername", "HTS Tvheadend");
- htsmsg_add_str(r, "serverversion", htsversion);
+ htsmsg_add_str(r, "serverversion", tvheadend_version);
htsmsg_add_bin(r, "challenge", htsp->htsp_challenge, 32);
htsp_update_logname(htsp);
#include "ffdecsa/FFdecsa.h"
int running;
-extern const char *htsversion;
-extern const char *htsversion_full;
time_t dispatch_clock;
static LIST_HEAD(, gtimer) gtimers;
pthread_mutex_t global_lock;
static void
usage(const char *argv0)
{
- printf("HTS Tvheadend %s\n", htsversion_full);
+ printf("HTS Tvheadend %s\n", tvheadend_version);
printf("usage: %s [options]\n", argv0);
printf("\n");
printf(" -a <adapters> Use only DVB adapters specified (csv)\n");
tvhlog(LOG_NOTICE, "START", "HTS Tvheadend version %s started, "
"running as PID:%d UID:%d GID:%d, settings located in '%s'",
- htsversion_full,
+ tvheadend_version,
getpid(), getuid(), getgid(), hts_settings_get_root());
if(crash)
}
-extern const char *htsversion_full;
-
-
void
trap_init(const char *ver)
{
"PRG: %s (%s) "
"[%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x] "
- "CWD: %s ", ver, htsversion_full,
+ "CWD: %s ", ver, tvheadend_version,
digest[0],
digest[1],
digest[2],
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#ifndef TVHEADEND_H
#define TVHEADEND_H
#include "redblack.h"
+extern const char *tvheadend_version;
+
#define PTS_UNSET INT64_C(0x8000000000000000)
extern pthread_mutex_t global_lock;
+#include "buildversion.h"
#include "config.h"
-#ifdef HTS_RELEASE_TAG
-const char *htsversion=HTS_RELEASE_TAG;
-const char *htsversion_full=HTS_RELEASE_TAG " (" HTS_VERSION ")";
-#else
-const char *htsversion=HTS_VERSION;
-const char *htsversion_full=HTS_VERSION;
-#endif
+const char *tvheadend_version = BUILD_VERSION;
#include "epg.h"
#include "iptv_input.h"
-extern const char *htsversion;
-extern const char *htsversion_full;
-
static void
extjs_load(htsbuf_queue_t *hq, const char *script)
{
"<body>\n"
"<div id=\"systemlog\"></div>\n"
"</body></html>\n",
- htsversion);
+ tvheadend_version);
http_output_html(hc);
return 0;
}
"<div class=\"about-title\">"
"HTS Tvheadend %s"
"</div><br>"
- "© 2006 - 2010 Andreas \303\226man, et al.<br><br>"
+ "© 2006 - 2012 Andreas \303\226man, et al.<br><br>"
"<img src=\"docresources/tvheadendlogo.png\"><br>"
"<a href=\"http://www.lonelycoder.com/hts\">"
"http://www.lonelycoder.com/hts</a><br><br>"
"<br><br>"
"Build: %s"
"</center>",
- htsversion,
- htsversion_full);
+ tvheadend_version,
+ tvheadend_version);
http_output_html(hc);
return 0;
#endif
extern char tvh_binshasum[20];
-extern char *htsversion_full;
int page_statedump(http_connection_t *hc, const char *remain, void *opaque);
htsbuf_qprintf(hq, "Tvheadend %s Binary SHA1: "
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
- htsversion_full,
+ tvheadend_version,
tvh_binshasum[0],
tvh_binshasum[1],
tvh_binshasum[2],
#!/bin/sh
-# check for SVN revision number
-revision=`cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
-test $revision || revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
-test $revision || revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
-test $revision && revision=SVN-r$revision
+revision=`$1/support/getver.sh`
-# check for git short hash
-if ! test $revision; then
- revision=`cd "$1" && git log -1 --pretty=format:%h`
- test $revision && revision=git-$revision
-fi
+NEW_REVISION="#define BUILD_VERSION \"$revision\""
+OLD_REVISION=`cat $2 2> /dev/null`
-# check for debian changelog
-if ! test $revision; then
- revision=`cd "$1" && cat debian/changelog |head -1|cut -f2 -d' '|sed s/\(//|sed s/\)//`
+# Update version.h only on revision changes to avoid spurious rebuilds
+if test "$NEW_REVISION" != "$OLD_REVISION"; then
+ echo "$NEW_REVISION" > "$2"
fi
-
-# no version number found
-test $revision || revision=UNKNOWN
-
-echo $revision