From 4372494fb8230cbf3a9d7de0b979d31bfda0da51 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Sat, 24 Nov 2012 16:27:04 +0900 Subject: Fix the build issues on MinGW --- data/Makefile.am | 9 +++++++-- data/reg2xml.c | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'data') 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)) { -- cgit v1.2.3