| 1 | # SPDX-FileCopyrightText: 2021 Michael Jeanson <mjeanson@efficios.com> |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro |
| 4 | # |
| 5 | # SYNOPSIS |
| 6 | # |
| 7 | # AE_IF_IN_GIT_REPO(ACTION-IF-TRUE, [ACTION-IF-FALSE]) |
| 8 | # |
| 9 | # DESCRIPTION |
| 10 | # |
| 11 | # Check if we are building from the git repository. |
| 12 | # |
| 13 | # The cache variable for this test is `ae_cv_in_git_repo`. |
| 14 | # |
| 15 | # --------------------------------------------------------------------------- |
| 16 | |
| 17 | #serial 2 |
| 18 | |
| 19 | AC_DEFUN([AE_IF_IN_GIT_REPO], [ |
| 20 | AC_CACHE_VAL([ae_cv_in_git_repo], [ |
| 21 | |
| 22 | dnl We're in the Git repository; the `bootstrap` file |
| 23 | dnl is not distributed in tarballs |
| 24 | AS_IF([test -f "$srcdir/bootstrap"], |
| 25 | [ae_cv_in_git_repo=yes], |
| 26 | [ae_cv_in_git_repo=no]) |
| 27 | ]) |
| 28 | |
| 29 | AS_IF([test "x$ae_cv_in_git_repo" = "xyes"], [dnl |
| 30 | $1 |
| 31 | ], [: dnl |
| 32 | $2 |
| 33 | ]) |
| 34 | ]) |