summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2012-11-24 16:27:04 +0900
committerAkira TAGOH <akira@tagoh.org>2012-11-24 16:27:04 +0900
commit4372494fb8230cbf3a9d7de0b979d31bfda0da51 (patch)
tree0c696c825bfe0bbedf59aa24f9d92d69dd928a8f /data
parent3d17b41abb82488842b99e0485357089ef3a4aa9 (diff)
Fix the build issues on MinGW
Diffstat (limited to 'data')
-rw-r--r--data/Makefile.am9
-rw-r--r--data/reg2xml.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index c731fe1..fc57794 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -59,9 +59,14 @@ am__v_DL_0 = @echo " DL " $@;
language-subtag-registry:
$(AM_V_DL) wget -O $@ http://www.iana.org/assignments/language-subtag-registry || \
curl -o $@ http://www.iana.org/assignments/language-subtag-registry
-language-subtag-registry.xml: language-subtag-registry reg2xml Makefile
- $(AM_V_GEN) $(builddir)/reg2xml $(srcdir)/language-subtag-registry $@.tmp; \
+if CROSS_COMPILING
+language-subtag-registry.xml: language-subtag-registry reg2xml.c Makefile
+ @echo Warning: Unable to rebuild $@ when cross-compiling
+else
+language-subtag-registry.xml: language-subtag-registry reg2xml$(EXEEXT) Makefile
+ $(AM_V_GEN) $(builddir)/reg2xml$(EXEEXT) $(srcdir)/language-subtag-registry $@.tmp; \
head -1 $@.tmp | grep -E '^<\?xml version'>/dev/null 2>&1 && mv $@.tmp $@ || (echo "E: $@ isn't an expected result"; rm $@.tmp)
+endif
stamp-core-zip:
-rm core.zip
$(AM_V_DL) wget http://unicode.org/Public/cldr/latest/core.zip || \
diff --git a/data/reg2xml.c b/data/reg2xml.c
index 6096af7..cffab86 100644
--- a/data/reg2xml.c
+++ b/data/reg2xml.c
@@ -148,12 +148,12 @@ _parse(const char *filename,
fsetpos(fp, &pos);
}
token = strstr(buffer, ": ");
- tag = strndup(buffer, token - buffer);
+ tag = lt_strndup(buffer, token - buffer);
token += 2;
rtag = strstr(token, "..");
if (rtag && rtag[2] != '.') {
/* the range in tags */
- begin = strndup(token, rtag - token);
+ begin = lt_strndup(token, rtag - token);
rtag += 2;
end = strdup(rtag);
if (strlen(begin) != strlen(end)) {