From d0cafa2d67b4765450deb5781b08f4241d9c4d3a Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 16 Feb 2016 14:59:04 +0000
Subject: [PATCH] changed the automake script

---
 src/Makefile.am |    3 +
 configure.ac    |    7 +++
 config.h.in     |    3 +
 config.h        |    3 +
 aclocal.m4      |   65 ++------------------------------
 5 files changed, 21 insertions(+), 60 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 7657505..da47901 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -180,61 +180,6 @@
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
-AC_DEFUN([PKG_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-m4_pushdef([pkg_description],
-    [pkg-config installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([pkgconfigdir],
-    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
-    [with_pkgconfigdir=]pkg_default)
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
-
-
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
-AC_DEFUN([PKG_NOARCH_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
-m4_pushdef([pkg_description],
-    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([noarch-pkgconfigdir],
-    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
-    [with_noarch_pkgconfigdir=]pkg_default)
-AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
-
-
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
-AC_DEFUN([PKG_CHECK_VAR],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
-
-_PKG_CONFIG([$1], [variable="][$3]["], [$2])
-AS_VAR_COPY([$1], [pkg_cv_][$1])
-
-AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
-
 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -318,9 +263,10 @@
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
@@ -787,8 +733,7 @@
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi
-])
+fi])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/config.h b/config.h
index 81910a1..d693bd1 100644
--- a/config.h
+++ b/config.h
@@ -84,6 +84,9 @@
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
+/* A string containing the version number */
+#define TS_VERSION "Trisurf (commit 588bbb-dirty) on natalie."
+
 /* Version number of package */
 #define VERSION "VERSION"
 
diff --git a/config.h.in b/config.h.in
index b68dfc5..cdffe53 100644
--- a/config.h.in
+++ b/config.h.in
@@ -83,6 +83,9 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* A string containing the version number */
+#undef TS_VERSION
+
 /* Version number of package */
 #undef VERSION
 
diff --git a/configure.ac b/configure.ac
index 4a01fa5..d2acada 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,13 @@
 AC_MSG_RESULT(no)
 fi
 
+#detect commit version and date
+#-                   ["Trisurf $VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
+#                   ["Trisurf (commit `cd $srcdir && git log -1 --format=format:%h`) on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
+AC_DEFINE_UNQUOTED(TS_VERSION,
+                    ["Trisurf (commit `git describe  --abbrev=6 --dirty --always --tags`) on `hostname`."],
+                    [A string containing the version number])
+
 # Checks for library functions.
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
diff --git a/src/Makefile.am b/src/Makefile.am
index 120a518..5646d8c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,3 +15,6 @@
 #spherical_trisurf_ffdir=../
 #spherical_trisurf_ff_PROGRAMS = spherical_trisurf_ff
 #spherical_trisurf_ff_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf_ff.c sh.c bondflip.c poly.c stats.c shcomplex.c
+
+#gitversion.c: .git/HEAD .git/index
+#    echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@

--
Gitblit v1.9.3