X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=m4%2Fae_in_git_repo.m4;fp=m4%2Fae_in_git_repo.m4;h=2e370fb50d4b54e0a0a6f184a30d41e8bc8f571f;hp=0000000000000000000000000000000000000000;hb=e0c79724b12e6205f9c408908529c091bf9a94e8;hpb=08fe49d3f91373ce29e32b3435886d996481f2f7 diff --git a/m4/ae_in_git_repo.m4 b/m4/ae_in_git_repo.m4 new file mode 100644 index 00000000..2e370fb5 --- /dev/null +++ b/m4/ae_in_git_repo.m4 @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (C) 2021 Michael Jeanson +# +# ae_in_git_repo.m4 -- Check if we are building from the git repo +# +# The cache variable for this test is `ae_cv_in_git_repo`. +# +# AE_IF_IN_GIT_REPO(ACTION-IF-TRUE, [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +AC_DEFUN([AE_IF_IN_GIT_REPO], [ + AC_CACHE_VAL([ae_cv_in_git_repo], [ + + dnl We're in the Git repository; the `bootstrap` file + dnl is not distributed in tarballs + AS_IF([test -f "$srcdir/bootstrap"], + [ae_cv_in_git_repo=yes], + [ae_cv_in_git_repo=no]) + ]) + + AS_IF([test "x$ae_cv_in_git_repo" = "xyes"], [dnl + $1 + ], [: dnl + $2 + ]) +])