isl_tab_pip.c \
isl_transitive_closure.c \
isl_vec.c \
+ isl_version.c \
isl_vertices_private.h \
isl_vertices.c
EXTRA_libisl_la_SOURCES = \
include/isl_set.h \
include/isl_stream.h \
include/isl_vec.h \
+ include/isl_version.h
include/isl_vertices.h
EXTRA_DIST = \
test_inputs
dist-hook:
+ echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
(cd doc; make manual.pdf)
cp doc/manual.pdf $(distdir)/doc/
pkgconfigdir=$(pkgconfig_libdir)
pkgconfig_DATA = $(pkgconfig_libfile)
+
+gitversion.h: @GIT_HEAD@
+ echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@
PACKAGE_CFLAGS="-I$prefix/include/isl"
AX_CREATE_PKGCONFIG_INFO
+AX_DETECT_GIT_HEAD
+echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
+
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_HEADERS(include/isl_config.h)
AC_CONFIG_FILES(Makefile)
user.tex: user.pod
$(PERL) $(srcdir)/mypod2latex $< $@
manual.pdf: manual.tex user.tex $(srcdir)/implementation.tex
+ (cd ..; echo "@GIT_HEAD_VERSION@") > version.tex
$(PDFLATEX) $<
bibtex manual
$(PDFLATEX) $<
$(PDFLATEX) $<
user.html: user.pod
- $(POD2HTML) --infile=$< --outfile=$@ --title="Integer Set Library: Manual"
+ (cd ..; echo "@GIT_HEAD_VERSION@") > version
+ $(POD2HTML) --infile=$< --outfile=$@ --title="Integer Set Library: Manual [version `cat version`]"
endif
\begin{document}
-\title{Integer Set Library: Manual}
+\title{Integer Set Library: Manual\\
+\small Version: \input{version} }
\author{Sven Verdoolaege}
\maketitle
--- /dev/null
+#ifndef ISL_VERSION_H
+#define ISL_VERSION_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+const char *isl_version(void);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
#include "isl_ctx.h"
#include "isl_options.h"
+#include <isl_version.h>
struct isl_arg_choice isl_lp_solver_choice[] = {
{"tab", ISL_LP_TAB},
{0}
};
+static void print_version(void)
+{
+ printf("%s", isl_version());
+}
+
struct isl_arg isl_options_arg[] = {
ISL_ARG_CHOICE(struct isl_options, lp_solver, 0, "lp-solver", \
isl_lp_solver_choice, ISL_LP_TAB, "lp solver to use")
ISL_BOUND_BERNSTEIN, "algorithm to use for computing bounds")
ISL_ARG_FLAGS(struct isl_options, bernstein_recurse, 0,
"bernstein-recurse", bernstein_recurse, ISL_BERNSTEIN_FACTORS, NULL)
+ISL_ARG_VERSION(print_version)
ISL_ARG_END
};
--- /dev/null
+#include "gitversion.h"
+
+const char *isl_version(void)
+{
+ return GIT_HEAD_ID"\n";
+}
--- /dev/null
+AC_DEFUN([AX_DETECT_GIT_HEAD], [
+ AC_SUBST(GIT_HEAD_ID)
+ AC_SUBST(GIT_HEAD)
+ AC_SUBST(GIT_HEAD_VERSION)
+ if test -f $srcdir/.git/HEAD; then
+ GIT_HEAD="$srcdir/.git/index"
+ GIT_REPO="$srcdir/.git"
+ GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe`
+ elif test -f $srcdir/GIT_HEAD_ID; then
+ GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID`
+ else
+ mysrcdir=`(cd $srcdir; pwd)`
+ head=`basename $mysrcdir | sed -e 's/.*-//'`
+ head2=`echo $head | sed -e 's/[^0-9a-f]//'`
+ head3=`echo $head2 | sed -e 's/........................................//'`
+ if test "x$head3" = "x" -a "x$head" = "x$head2"; then
+ GIT_HEAD_ID="$head"
+ else
+ GIT_HEAD_ID="UNKNOWN"
+ fi
+ fi
+ if test -z "$GIT_REPO" ; then
+ GIT_HEAD_VERSION="$GIT_HEAD_ID"
+ else
+ GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe\`"
+ fi
+])