File: lepton-git.m4

package info (click to toggle)
lepton-eda 1.9.18-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,024 kB
  • sloc: ansic: 66,688; lisp: 29,508; sh: 6,792; makefile: 3,111; perl: 1,404; pascal: 1,161; lex: 887; sed: 16; cpp: 8
file content (47 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# lepton-git.m4                                           -*-Autoconf-*-
# serial 2

dnl Generic checks relating to git tools & repositories
dnl Copyright (C) 2009-2011  Peter Brett <peter@peter-b.co.uk>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

# Check if git is available, and which git to use.
AC_DEFUN([AX_PROG_GIT],
[
  AC_PREREQ([2.60])dnl
  AC_ARG_VAR([GIT], [Path to git executable])
  AC_CHECK_PROG([GIT], [git], [git], [no])
])dnl AX_PROG_GIT

# Check if the source directory is a git repository
AC_DEFUN([AX_GIT_REPO],
[
  AC_PREREQ([2.60])dnl
  AC_REQUIRE([AX_PROG_GIT])dnl

  HAVE_GIT_REPO=no
  if test "X$GIT" != "Xno"; then
    AC_MSG_CHECKING([if the source directory is a git repository])
    if (cd $srcdir && $GIT rev-parse --git-dir > /dev/null 2>&1); then
      AC_MSG_RESULT([yes])
      HAVE_GIT_REPO=yes
    else
      AC_MSG_RESULT([no])
    fi
  fi

  AC_SUBST([HAVE_GIT_REPO])
])dnl AX_GIT_REPO