Commit | Line | Data |
---|---|---|
e03d7c66 | 1 | # SPDX-FileCopyrightText: 2021 Michael Jeanson <mjeanson@efficios.com> |
0c2f8444 | 2 | # |
e03d7c66 | 3 | # SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro |
0c2f8444 | 4 | # |
e03d7c66 MJ |
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. | |
0c2f8444 MJ |
12 | # |
13 | # The cache variable for this test is `ae_cv_in_git_repo`. | |
14 | # | |
0c2f8444 | 15 | # --------------------------------------------------------------------------- |
e03d7c66 MJ |
16 | |
17 | #serial 2 | |
18 | ||
0c2f8444 MJ |
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 | ]) |