Commit 6f939658 authored by Karl Wette's avatar Karl Wette Committed by Adam Mercer
Browse files

New autoconf macro to check for git and a git repository

- call macro from all library ./configures
Original: 38616fb1079c828ae18f707cd106068518abf30e
parent 1f41c42a
# lalsuite_build.m4 - top level build macros
#
# serial 46
# serial 47
AC_DEFUN([LALSUITE_CHECK_GIT_REPO],[
# check for git
AC_PATH_PROGS(GIT,[git],[false])
# check whether building from a git repository
have_git_repo=no
AS_IF([test "x${GIT}" != xfalse],[
AC_MSG_CHECKING([whether building from a git repository])
# git log will print:
# * the last log message, if the cwd is in a git repository
# * nothing, if the cwd is not part of the git repo (e.g. ignored)
# * an error msg to stderr if the cwd is not in a git repository
git_log=`( cd "${srcdir}" && ${GIT} log --oneline -n 1 -- . ) 2>/dev/null`
AS_IF([test "x${git_log}" != x],[
have_git_repo=yes
])
AC_MSG_RESULT([${have_git_repo}])
])
# conditional for git and building from a git repository
AM_CONDITIONAL(HAVE_GIT_REPO,[test "x${have_git_repo}" = xyes])
# command line for version information generation script
AM_COND_IF(HAVE_GIT_REPO,[
m4_pattern_allow([AM_V_GEN])
m4_pattern_allow([AM_V_at])
AC_SUBST([genvcsinfo_],["\$(genvcsinfo_\$(AM_DEFAULT_VERBOSITY))"])
AC_SUBST([genvcsinfo_0],["--am-v-gen='\$(AM_V_GEN)'"])
GENERATE_VCS_INFO="\$(AM_V_at)\$(PYTHON) \$(top_srcdir)/../gnuscripts/generate_vcs_info.py --git-path='\$(GIT)' \$(genvcsinfo_\$(V))"
],[
GENERATE_VCS_INFO=false
])
AC_SUBST(GENERATE_VCS_INFO)
])
AC_DEFUN([LALSUITE_REQUIRE_CXX],[
# require a C++ compiler
......
......@@ -139,6 +139,8 @@ AC_SUBST([LIBREVISION_SUPPORT],[3])
AC_SUBST([LIBAGE_SUPPORT],[1])
AC_SUBST([LIBVERSION_SUPPORT],[${LIBCURRENT_SUPPORT}:${LIBREVISION_SUPPORT}:${LIBAGE_SUPPORT}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
LAL_WITH_CC
LAL_WITH_CFLAGS
......
......@@ -61,6 +61,9 @@ AC_CANONICAL_HOST
LALSUITE_ARG_VAR
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
# check for git repo
LALSUITE_CHECK_GIT_REPO
LALAPPS_WITH_CC
LALAPPS_WITH_LAL_PREFIX
LALAPPS_WITH_EXTRA_CPPFLAGS
......
......@@ -43,6 +43,9 @@ AC_SUBST([LIBREVISION],[3])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -46,6 +46,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -46,6 +46,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -41,6 +41,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[1])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -47,6 +47,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -40,6 +40,9 @@ AC_SUBST([LIBREVISION],[2])
AC_SUBST([LIBAGE],[2])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -46,6 +46,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -46,6 +46,9 @@ AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -41,6 +41,9 @@ AC_SUBST([LIBREVISION],[4])
AC_SUBST([LIBAGE],[2])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
......@@ -46,6 +46,9 @@ AC_SUBST([LIBREVISION],[4])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
# check for git repo
LALSUITE_CHECK_GIT_REPO
# nightly build
LALSUITE_ENABLE_NIGHTLY
......
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