Commit f435e460 authored by Tollef Fog Heen's avatar Tollef Fog Heen Committed by Tollef Fog Heen

Rename vcs_version.c to vcs_version.h

Adjust build system accordingly.
parent 25ef2496
...@@ -45,7 +45,7 @@ TAGS ...@@ -45,7 +45,7 @@ TAGS
/include/vcl_returns.h /include/vcl_returns.h
/include/vrt_obj.h /include/vrt_obj.h
/include/vrt_stv_var.h /include/vrt_stv_var.h
/lib/libvarnish/vcs_version.c /lib/libvarnish/vcs_version.h
/lib/libvcl/vcc_fixed_token.c /lib/libvcl/vcc_fixed_token.c
/lib/libvcl/vcc_obj.c /lib/libvcl/vcc_obj.c
/lib/libvcl/vcc_token_defs.h /lib/libvcl/vcc_token_defs.h
......
...@@ -14,7 +14,7 @@ libvarnish_la_SOURCES = \ ...@@ -14,7 +14,7 @@ libvarnish_la_SOURCES = \
cli_serve.c \ cli_serve.c \
flopen.c \ flopen.c \
num.c \ num.c \
vcs_version.c \ vcs_version.h \
time.c \ time.c \
tcp.c \ tcp.c \
vct.c \ vct.c \
...@@ -33,11 +33,13 @@ libvarnish_la_SOURCES = \ ...@@ -33,11 +33,13 @@ libvarnish_la_SOURCES = \
libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @PCRE_LIBS@ libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @PCRE_LIBS@
DISTCLEANFILES = vcs_version.c version.o: vcs_version.h
vcs_version.c: FORCE
DISTCLEANFILES = vcs_version.h
vcs_version.h: FORCE
if [ -d "$(top_srcdir)/.git" ]; then \ if [ -d "$(top_srcdir)/.git" ]; then \
V="$$(git describe --always)" \ V="$$(git describe --always)" \
H="$$(head -n 1 vcs_version.c 2>/dev/null || true)"; \ H="$$(head -n 1 vcs_version.h 2>/dev/null || true)"; \
if [ "/* $$V */" != "$$H" ]; then \ if [ "/* $$V */" != "$$H" ]; then \
( \ ( \
echo "/* $$V */" ;\ echo "/* $$V */" ;\
...@@ -48,12 +50,8 @@ vcs_version.c: FORCE ...@@ -48,12 +50,8 @@ vcs_version.c: FORCE
echo ' *' ;\ echo ' *' ;\
echo ' */' ;\ echo ' */' ;\
echo '' ;\ echo '' ;\
echo "#include <libvarnish.h>" ;\ echo "#define VCS_Version \"$$V\"" \
echo "const char* VCS_Version(void)" ;\ ) > vcs_version.h ; \
echo "{" ;\
echo " return (\"$$V\");" ;\
echo "}" ;\
) > vcs_version.c ; \
fi \ fi \
fi fi
FORCE: FORCE:
......
...@@ -34,12 +34,13 @@ ...@@ -34,12 +34,13 @@
#include <stdio.h> #include <stdio.h>
#include "libvarnish.h" #include "libvarnish.h"
#include "vcs_version.h"
void void
VCS_Message(const char *progname) VCS_Message(const char *progname)
{ {
fprintf(stderr, "%s (%s-%s revision %s)\n", progname, fprintf(stderr, "%s (%s-%s revision %s)\n", progname,
PACKAGE_TARNAME, PACKAGE_VERSION, VCS_Version()); PACKAGE_TARNAME, PACKAGE_VERSION, VCS_Version);
fprintf(stderr, "Copyright (c) 2006 Verdens Gang AS\n"); fprintf(stderr, "Copyright (c) 2006 Verdens Gang AS\n");
fprintf(stderr, "Copyright (c) 2006-2011 Varnish Software AS\n"); fprintf(stderr, "Copyright (c) 2006-2011 Varnish Software AS\n");
} }
...@@ -12,7 +12,7 @@ libvarnishapi_la_SOURCES = \ ...@@ -12,7 +12,7 @@ libvarnishapi_la_SOURCES = \
\ \
../libvarnish/assert.c \ ../libvarnish/assert.c \
../libvarnish/argv.c \ ../libvarnish/argv.c \
../libvarnish/vcs_version.c \ ../libvarnish/vcs_version.h \
../libvarnish/version.c \ ../libvarnish/version.c \
../libvarnish/cli_common.c \ ../libvarnish/cli_common.c \
../libvarnish/cli_auth.c \ ../libvarnish/cli_auth.c \
......
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