AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
AC_PATH_PROG([GEN4ASM], [intel-gen4asm])
+dnl Check for git
+AC_ARG_VAR([GIT], [Path to git program, if any])
+AC_PATH_PROG([GIT], [git])
+AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"])
+
dnl Check for VA-API
PKG_CHECK_MODULES(LIBVA_DEPS, [libva >= va_api_version])
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-SUBDIRS = shaders
+SUBDIRS = shaders
+DIST_SUBDIRS = $(SUBDIRS)
+EXTRA_DIST =
+BUILT_SOURCES =
AM_CPPFLAGS = \
-DPTHREADS \
intel_driver.h \
intel_media.h \
intel_memman.h \
+ intel_version.h \
object_heap.h \
sysdeps.h \
va_backend_compat.h \
driver_cflags += $(WAYLAND_CFLAGS)
endif
+# git version
+VERSION_FILE = .VERSION
+OLD_VERSION_FILE = $(VERSION_FILE).old
+NEW_VERSION_FILE = $(VERSION_FILE).new
+PKG_VERSION_FILE = $(VERSION_FILE).pkg
+
+intel_version.h: gen-version
+ $(AM_V_GEN) \
+ OV=`[ -f $(OLD_VERSION_FILE) ] && cat $(OLD_VERSION_FILE) || :`; \
+ NV=`cat $(NEW_VERSION_FILE)`; \
+ if [ "$$OV" != "$$NV" -o ! -f intel_version.h ]; then \
+ cp -f $(NEW_VERSION_FILE) $(OLD_VERSION_FILE); \
+ $(SED) -e "s|\@INTEL_DRIVER_GIT_VERSION\@|$${NV}|" \
+ $(srcdir)/intel_version.h.in > intel_version.h; \
+ fi
+
+gen-version:
+ @echo $(VERSION) > $(NEW_VERSION_FILE)
+if HAVE_GIT
+ @[ -d $(top_srcdir)/.git ] && \
+ (cd $(top_srcdir) && $(GIT) describe --tags) > $(NEW_VERSION_FILE) || :
+endif
+ @[ -f $(srcdir)/$(PKG_VERSION_FILE) ] && \
+ cp -f $(srcdir)/$(PKG_VERSION_FILE) $(NEW_VERSION_FILE) || :
+
+$(PKG_VERSION_FILE): $(NEW_VERSION_FILE)
+ @cp -f $< $@
+
+BUILT_SOURCES += intel_version.h
+EXTRA_DIST += intel_version.h.in $(PKG_VERSION_FILE)
+
# Wayland protocol
protocol_source_h = wayland-drm-client-protocol.h
i965_output_wayland.c: $(protocol_source_h)
@wayland_scanner_rules@
-DIST_SUBDIRS = $(SUBDIRS) wayland
+DIST_SUBDIRS += wayland
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in config.h.in
# include "i965_output_wayland.h"
#endif
+#include "intel_version.h"
#include "intel_driver.h"
#include "intel_memman.h"
#include "intel_batchbuffer.h"
if (ret < 0 || ret >= sizeof(i965->va_vendor))
goto error;
len += ret;
+
+ ret = snprintf(&i965->va_vendor[len], sizeof(i965->va_vendor) - len,
+ " (%s)", INTEL_DRIVER_GIT_VERSION);
+ if (ret < 0 || ret >= sizeof(i965->va_vendor))
+ goto error;
+ len += ret;
}
return true;
--- /dev/null
+/*
+ * Copyright (C) 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef INTEL_VERSION_H
+#define INTEL_VERSION_H
+
+/**
+ * INTEL_DRIVER_GIT_VERSION:
+ *
+ * The full version identifier of libva-intel-driver, from a git
+ * repository, in string form (suitable for string concatenation).
+ */
+#define INTEL_DRIVER_GIT_VERSION "@INTEL_DRIVER_GIT_VERSION@"
+
+#endif /* INTEL_VERSION_H */