Allow building with xmlparse.h
expat 1.1 and 1.2 provide xmlparse.h instead of expat.h. Include the former on systems that define the EXPAT_NEEDS_XMLPARSE_H variable and define that variable on QNX systems, which ship with expat 1.1. Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matt Kraai committed
Feb 11, 2013 at 14:03 UTC
081fd8d093887b0cc5055d8a191ae2c26274846b
3 files changed
+11
Makefile
+6
@@ -43,6 +43,9 @@ all::
43
# Define EXPATDIR=/foo/bar if your expat header and library files are in
44
# /foo/bar/include and /foo/bar/lib directories.
45
#
46
+# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
47
+# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
48
+#
49
# Define NO_GETTEXT if you don't want Git output to be translated.
50
# A translated Git requires GNU libintl or another gettext implementation,
51
# plus libintl-perl at runtime.
@@ -1089,6 +1092,9 @@ else
1092
else
1093
EXPAT_LIBEXPAT = -lexpat
1094
endif
1095
+ ifdef EXPAT_NEEDS_XMLPARSE_H
1096
+ BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H
1097
+ endif
1098
endif
1099
endif
1100
config.mak.uname
+1
@@ -523,6 +523,7 @@ endif
523
endif
524
ifeq ($(uname_S),QNX)
525
COMPAT_CFLAGS += -DSA_RESTART=0
526
+ EXPAT_NEEDS_XMLPARSE_H = YesPlease
527
HAVE_STRINGS_H = YesPlease
528
NEEDS_SOCKET = YesPlease
529
NO_FNMATCH_CASEFOLD = YesPlease
http-push.c
+4
@@ -11,7 +11,11 @@
11
#include "list-objects.h"
12
#include "sigchain.h"
13
14
+#ifdef EXPAT_NEEDS_XMLPARSE_H
15
+#include <xmlparse.h>
16
+#else
17
#include <expat.h>
18
+#endif
19
20
static const char http_push_usage[] =
21
"git http-push [--all] [--dry-run] [--force] [--verbose] <remote> [<head>...]\n";