compat/regex: get the gawk regex engine to compile within git
We need to define -DGAWK -DNO_MBSUPPORT so that the gawk regex engine will compile, and include stdio.h and stddef.h in regex.h. Gawk itself includes these headers before it includes the regex.h header. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Aug 17, 2010 at 09:24 UTC
a997bf423d4baac5b2286edccd1cef897108397f
2 files changed
+7
Makefile
+4
@@ -1878,6 +1878,10 @@ ifdef NO_EXPAT
1878
http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
1879
endif
1880
1881
+ifdef NO_REGEX
1882
+compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
1883
+endif
1884
+
1885
git-%$X: %.o $(GITLIBS)
1886
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
1887
compat/regex/regex.h
+3
@@ -1,3 +1,6 @@
1
+#include <stdio.h>
2
+#include <stddef.h>
3
+
4
/* Definitions for data structures and routines for the regular
5
expression library.
6
Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008