Commit 1ca2924c authored by Simon Morlat's avatar Simon Morlat

improve git versionning in binary

parent dd396683
EXTRA_DIST=mediastreamer-config.h.in pkg.list autogen.sh mediastreamer.pc.in mediastreamer2.spec.in mediastreamer2.spec gitversion.h
EXTRA_DIST=mediastreamer-config.h.in pkg.list autogen.sh mediastreamer.pc.in mediastreamer2.spec.in mediastreamer2.spec gitversion.h
SUBDIRS=po src build include tests help
......@@ -60,3 +62,7 @@ clean-local:
endif WITH_EPM
ACLOCAL_AMFLAGS = -I m4
......@@ -57,9 +57,3 @@ $ACLOCAL $ACLOCAL_ARGS
autoheader
$AUTOMAKE --force-missing --add-missing --copy ${AUTOMAKE_FLAGS}
autoconf
if ! test -e ".git/hooks/pre-commit" ; then
echo "Installing pre-commit hook in git tree."
cp build/git-pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
fi
GITVERSION_FILE=gitversion.h
GITVERSION_FILE=src/gitversion.h
echo -n "#define GIT_VERSION " > $GITVERSION_FILE
echo \"`git describe`\" >> $GITVERSION_FILE
......
......@@ -16,7 +16,6 @@ src/msspeex.c
src/msvolume.c
src/msv4l.c
src/msv4l2.c
src/msv4m.m
src/nowebcam.c
src/oss.c
src/pixconv.c
......@@ -45,3 +44,5 @@ src/msiounit.c
src/x11video.c
src/msandroid.cpp
src/msandroidvideo.cpp
src/vp8.c
GITVERSION_FILE=gitversion.h
GITVERSION_FILE_TMP=gitversion.h.tmp
ANDROID_SRC_FILES= \
msandroid.cpp \
......@@ -9,17 +10,18 @@ ANDROID_SRC_FILES= \
EXTRA_DIST= winsnd2.c winsnd.c winvideo.c \
winvideods.c wincevideods.c dxfilter.h dxfilter.cpp \
msfileplayer_win.c msfilerec_win.c winsndds.cpp nowebcamCIF.jpg winsnd3.c vfw-missing.h \
winvideo2.c msjava.c $(ANDROID_SRC_FILES)
winvideo2.c msjava.c $(ANDROID_SRC_FILES) \
$(GITVERSION_FILE)
BUILT_SOURCES=alldescs.h
BUILT_SOURCES=alldescs.h $(GITVERSION_FILE)
CLEANFILES=alldescs.h filterdescs.txt
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/include/
INCLUDES=-I$(top_srcdir)/include/
lib_LTLIBRARIES=libmediastreamer.la
libmediastreamer_la_SOURCES= mscommon.c \
libmediastreamer_la_SOURCES= mscommon.c $(GITVERSION_FILE) \
msfilter.c \
msqueue.c \
msticker.c \
......@@ -51,9 +53,9 @@ libmediastreamer_la_SOURCES= mscommon.c \
tonedetector.c \
bitratecontrol.c \
qualityindicator.c \
g722_decode.c \
g722_decode.c g722.h \
g722_encode.c \
msg722.c
msg722.c
#dummy c++ file to force libtool to use c++ linking (because of msdscap-mingw.cc)
......@@ -248,3 +250,23 @@ imgdir=$(datadir)/images/
img_DATA=nowebcamCIF.jpg
make_gitversion_h:
if test -d $(top_srcdir)/.git ; then \
echo -n "#define GIT_VERSION " > $(GITVERSION_FILE_TMP) &&\
echo \"`git describe`\" >> $(GITVERSION_FILE_TMP) &&\
if test "`cat $(GITVERSION_FILE_TMP)`" != "`cat $(srcdir)/$(GITVERSION_FILE)`" ; then \
cp -f $(GITVERSION_FILE_TMP) $(srcdir)/$(GITVERSION_FILE) ; \
fi \
&& rm -f $(GITVERSION_FILE_TMP) ;\
fi
if ! test -f $(GITVERSION_FILE) ; then \
echo -n "#define GIT_VERSION \"unknown\" " > $(GITVERSION_FILE) ;\
fi
$(GITVERSION_FILE): make_gitversion_h
......@@ -19,6 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef HAVE_CONFIG_H
#include "mediastreamer-config.h"
#include "gitversion.h"
#else
# ifndef GIT_VERSION
# define GIT_VERSION "unknown"
# endif
#endif
extern void __register_ffmpeg_encoders_if_possible(void);
......@@ -28,7 +33,7 @@ extern void libmsandroiddisplay_init(void);
#include "mediastreamer2/mscommon.h"
#include "mediastreamer2/msfilter.h"
#include "gitversion.h"
#include "alldescs.h"
#include "mediastreamer2/mssndcard.h"
......@@ -597,7 +602,7 @@ void ms_init(){
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
ortp_set_log_handler(ms_android_log_handler);
#endif
ms_message("Mediastreamer2 " GIT_VERSION " starting.");
ms_message("Mediastreamer2 " MEDIASTREAMER_VERSION " (git: " GIT_VERSION ") starting.");
/* register builtin MSFilter's */
for (i=0;ms_filter_descs[i]!=NULL;i++){
ms_filter_register(ms_filter_descs[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment