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
/include/vcl_returns.h
/include/vrt_obj.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_obj.c
/lib/libvcl/vcc_token_defs.h
......
......@@ -14,7 +14,7 @@ libvarnish_la_SOURCES = \
cli_serve.c \
flopen.c \
num.c \
vcs_version.c \
vcs_version.h \
time.c \
tcp.c \
vct.c \
......@@ -33,11 +33,13 @@ libvarnish_la_SOURCES = \
libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @PCRE_LIBS@
DISTCLEANFILES = vcs_version.c
vcs_version.c: FORCE
version.o: vcs_version.h
DISTCLEANFILES = vcs_version.h
vcs_version.h: FORCE
if [ -d "$(top_srcdir)/.git" ]; then \
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 \
( \
echo "/* $$V */" ;\
......@@ -48,12 +50,8 @@ vcs_version.c: FORCE
echo ' *' ;\
echo ' */' ;\
echo '' ;\
echo "#include <libvarnish.h>" ;\
echo "const char* VCS_Version(void)" ;\
echo "{" ;\
echo " return (\"$$V\");" ;\
echo "}" ;\
) > vcs_version.c ; \
echo "#define VCS_Version \"$$V\"" \
) > vcs_version.h ; \
fi \
fi
FORCE:
......
......@@ -34,12 +34,13 @@
#include <stdio.h>
#include "libvarnish.h"
#include "vcs_version.h"
void
VCS_Message(const char *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-2011 Varnish Software AS\n");
}
......@@ -12,7 +12,7 @@ libvarnishapi_la_SOURCES = \
\
../libvarnish/assert.c \
../libvarnish/argv.c \
../libvarnish/vcs_version.c \
../libvarnish/vcs_version.h \
../libvarnish/version.c \
../libvarnish/cli_common.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