| 1 | # SPDX-License-Identifier: MIT |
| 2 | # |
| 3 | # Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com> |
| 4 | # |
| 5 | # ae_in_git_repo.m4 -- Check if we are building from the git repo |
| 6 | # |
| 7 | # The cache variable for this test is `ae_cv_in_git_repo`. |
| 8 | # |
| 9 | # AE_IF_IN_GIT_REPO(ACTION-IF-TRUE, [ACTION-IF-FALSE]) |
| 10 | # --------------------------------------------------------------------------- |
| 11 | AC_DEFUN([AE_IF_IN_GIT_REPO], [ |
| 12 | AC_CACHE_VAL([ae_cv_in_git_repo], [ |
| 13 | |
| 14 | dnl We're in the Git repository; the `bootstrap` file |
| 15 | dnl is not distributed in tarballs |
| 16 | AS_IF([test -f "$srcdir/bootstrap"], |
| 17 | [ae_cv_in_git_repo=yes], |
| 18 | [ae_cv_in_git_repo=no]) |
| 19 | ]) |
| 20 | |
| 21 | AS_IF([test "x$ae_cv_in_git_repo" = "xyes"], [dnl |
| 22 | $1 |
| 23 | ], [: dnl |
| 24 | $2 |
| 25 | ]) |
| 26 | ]) |