summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Makefile8
-rwxr-xr-xconfigure14
3 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 00fd4316..b457d440 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-11 Kaz Kylheku <kaz@kylheku.com>
+
+ * configure (have_git): New variable and configure test for git.
+
+ * Makefile (SRCS): Only set if git is available.
+ (enforce): Fail if we don't have git.
+
2014-12-10 Kaz Kylheku <kaz@kylheku.com>
Throwing away old dependency system.
diff --git a/Makefile b/Makefile
index 56169677..2e762ff3 100644
--- a/Makefile
+++ b/Makefile
@@ -45,11 +45,14 @@ OBJS += arith.o hash.o utf8.o filter.o eval.o rand.o combi.o sysif.o
OBJS-$(debug_support) += debug.o
OBJS-$(have_syslog) += syslog.o
OBJS-$(have_posix_sigs) += signal.o
+
+ifneq ($(have_git),)
SRCS := $(addprefix $(top_srcdir)/,\
$(filter-out lex.yy.c y.tab.c y.tab.h,\
$(shell git --work-tree=$(top_srcdir) \
--git-dir=$(top_srcdir)/.git \
ls-files "*.c" "*.h" "*.l" "*.y")))
+endif
# MPI objects
MPI_OBJ_BASE=mpi.o mplogic.o
@@ -233,9 +236,14 @@ endef
.PHONY: enforce
enforce:
+ifneq ($(have_git),)
$(call GREP_CHECK,'\<void[ ]*\*',void *,1,-v 'typedef void \*yyscan_t')
$(call GREP_CHECK,' ',tabs,0,'.')
$(call GREP_CHECK,' $$',trailing spaces,0,'.')
+else
+ echo "enforce requires git"
+ exit 1
+endif
#
# Installation macro.
diff --git a/configure b/configure
index 8b6e4d7a..6eedf21e 100755
--- a/configure
+++ b/configure
@@ -120,6 +120,7 @@ have_syslog=
have_windows_h=
have_posix_sigs=
need_darwin_c_source=
+have_git=
#
# Parse configuration variables
@@ -627,6 +628,8 @@ mpi_version := $mpi_version
# EXE suffix
EXE := $exe
+have_git := $have_git
+
CC := $cc
LEX := $lex
YACC := $yacc
@@ -699,6 +702,17 @@ conftest_syms()
$make conftest.syms ${@+"$@"} > conftest.err 2>&1
}
+#
+# Check for git because we use it out of the Makefile
+#
+printf "Checking whether we have git ... "
+
+if git --version > /dev/null 2> /dev/null ; then
+ have_git=y
+ printf "yes\n"
+else
+ printf "missing\n"
+fi
#
# Check C compiler sanity