[polly] r247142 - Generate gitversion.h in autoconf builds

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 06:15:12 PDT 2015


Author: meinersbur
Date: Wed Sep  9 08:15:11 2015
New Revision: 247142

URL: http://llvm.org/viewvc/llvm-project?rev=247142&view=rev
Log:
Generate gitversion.h in autoconf builds

Add a custom makefile rule to generate lib/External/isl/gitversion.h
from GIT_HEAD_ID and trigger it using BULIT_SOURCES to ensure the file
exists before compilation starts.

The latest ISL creates gitversion.h from Makefile.am only, instead also
from configure.ac in previous version. While the Polly build invokes
configure, it does not invoke ISL's make such that the file was missing.

Invoking ISL's make would come with additional problems such as
triggering automake because of not preserved file time stamps.
Re-running automake might not be successful on other system
configurations for instance because it was preconfigured without
--with-clang option.


Modified:
    polly/trunk/autoconf/configure.ac
    polly/trunk/lib/Makefile

Modified: polly/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/autoconf/configure.ac?rev=247142&r1=247141&r2=247142&view=diff
==============================================================================
--- polly/trunk/autoconf/configure.ac (original)
+++ polly/trunk/autoconf/configure.ac Wed Sep  9 08:15:11 2015
@@ -95,7 +95,7 @@ dnl ************************************
 dnl * Create the output files
 dnl **************************************************************************
 
-dnl Let ISL's configure generate isl_config.h and gitversion.h
+dnl Let ISL's configure generate isl_config.h
 AC_CONFIG_SUBDIRS(lib/External/isl)
 AC_CONFIG_COMMANDS_POST([
   dnl Configure ISL with small integer optimization, but do not add the

Modified: polly/trunk/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Makefile?rev=247142&r1=247141&r2=247142&view=diff
==============================================================================
--- polly/trunk/lib/Makefile (original)
+++ polly/trunk/lib/Makefile Wed Sep  9 08:15:11 2015
@@ -108,6 +108,11 @@ ISL_FILES= External/isl/basis_reduction_
            External/isl/imath/imath.c \
            External/isl/imath/imrat.c
 
+External/isl/gitversion.h:
+	@echo '#define GIT_HEAD_ID "'`cat "${PROJ_SRC_DIR}/External/isl/GIT_HEAD_ID"`'"' > $@
+
+BUILT_SOURCES=External/isl/gitversion.h
+
 SOURCES= Polly.cpp \
          Support/GICHelper.cpp \
          Support/SCEVValidator.cpp \




More information about the llvm-commits mailing list