CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
glibc: initial import (verified compilation)
[crossrootfs.git] / glibc / glibc-2.13-cross_hacks-2.patch
CommitLineData
6dca1d21
JB
1Submitted By: Joe Ciccone <jciccone@gmail.com>
2Date: 2006-11-26
3Initial Package Version: 2.5
4 Rediffed against 2.6 by Joe Ciccone
5 Rediffed against 2.8 by Joe Ciccone on 2009-01-03
6 Rediffed against 2.9 by Joe Ciccone on 2009-03-15
624a0b95 7 Rediffed against 2.10.1 by crux-arm@mikeux.dyndns.org 2009-12-16
6dca1d21
JB
8Origin: Joe Ciccone
9Upstream Status: Unknown
10Description: Adds native compile support to the build system then uses that
11 support to build zic-native, for installing timezone info,
12 rpcgen-native, for building librpcsvc.a, and localedef-native,
13 for creating the locale-archive.
14
624a0b95
VM
15diff -Naur glibc-2.10.1.orig/iconv/Makefile glibc-2.10.1/iconv/Makefile
16--- glibc-2.10.1.orig/iconv/Makefile 2007-07-24 23:41:17.000000000 -0400
17+++ glibc-2.10.1/iconv/Makefile 2009-03-15 19:22:15.732837951 -0400
6dca1d21
JB
18@@ -57,6 +57,9 @@
19 iconvconfig.h
20
21 others = iconv_prog iconvconfig
22+ifneq ($(cross-compiling),no)
23+ others-native = iconvconfig-native
24+endif
25 install-others-programs = $(inst_bindir)/iconv
26 install-sbin = iconvconfig
27
28@@ -79,6 +82,7 @@
29
30 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
31 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
32+$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
33
34 ifneq ($(cross-compiling),yes)
35 xtests: test-iconvconfig
624a0b95
VM
36diff -Naur glibc-2.10.1.orig/iconvdata/Makefile glibc-2.10.1/iconvdata/Makefile
37--- glibc-2.10.1.orig/iconvdata/Makefile 2008-05-14 21:54:31.000000000 -0400
38+++ glibc-2.10.1/iconvdata/Makefile 2009-03-15 19:22:15.753163155 -0400
6dca1d21
JB
39@@ -320,23 +320,25 @@
40
41 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
42
43+ifeq ($(cross-compiling),no)
44+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
45+ $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
46+ $(common-objpfx)iconv/iconvconfig
47+else
48+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
49+ $(common-objpfx)iconv/iconvconfig-native
50+endif
51+
52 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
53 $(inst_gconvdir)/%: $(objpfx)% $(+force)
54 $(do-install-program)
55 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
56 $(do-install)
57-ifeq (no,$(cross-compiling))
58 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
59 # if this libc has more gconv modules than the previously installed one.
60 if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
61- LC_ALL=C LANGUAGE=C \
62- $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
63- $(common-objpfx)iconv/iconvconfig \
64- $(addprefix --prefix=,$(install_root)); \
65+ $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
66 fi
67-else
68- @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
69-endif
70
71 endif # build-shared = yes
72
624a0b95
VM
73diff -Naur glibc-2.10.1.orig/include-native/bits/libc-tsd.h glibc-2.10.1/include-native/bits/libc-tsd.h
74--- glibc-2.10.1.orig/include-native/bits/libc-tsd.h 1969-12-31 19:00:00.000000000 -0500
75+++ glibc-2.10.1/include-native/bits/libc-tsd.h 2009-03-15 19:22:15.788787576 -0400
6dca1d21
JB
76@@ -0,0 +1,3 @@
77+#ifndef __libc_tsd_define
78+#define __libc_tsd_define(A,B,C)
79+#endif
624a0b95
VM
80diff -Naur glibc-2.10.1.orig/include-native/config.h glibc-2.10.1/include-native/config.h
81--- glibc-2.10.1.orig/include-native/config.h 1969-12-31 19:00:00.000000000 -0500
82+++ glibc-2.10.1/include-native/config.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
83@@ -0,0 +1 @@
84+/* Empty */
624a0b95
VM
85diff -Naur glibc-2.10.1.orig/include-native/gnu/stubs.h glibc-2.10.1/include-native/gnu/stubs.h
86--- glibc-2.10.1.orig/include-native/gnu/stubs.h 1969-12-31 19:00:00.000000000 -0500
87+++ glibc-2.10.1/include-native/gnu/stubs.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
88@@ -0,0 +1 @@
89+/* Empty */
624a0b95
VM
90diff -Naur glibc-2.10.1.orig/include-native/intl/loadinfo.h glibc-2.10.1/include-native/intl/loadinfo.h
91--- glibc-2.10.1.orig/include-native/intl/loadinfo.h 1969-12-31 19:00:00.000000000 -0500
92+++ glibc-2.10.1/include-native/intl/loadinfo.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
93@@ -0,0 +1,4 @@
94+#ifndef LOADINFO_H
95+#define LOADINFO_H
96+struct loaded_l10nfile;
97+#endif
624a0b95
VM
98diff -Naur glibc-2.10.1.orig/include-native/libintl.h glibc-2.10.1/include-native/libintl.h
99--- glibc-2.10.1.orig/include-native/libintl.h 1969-12-31 19:00:00.000000000 -0500
100+++ glibc-2.10.1/include-native/libintl.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
101@@ -0,0 +1,13 @@
102+#include_next <libintl.h>
103+
104+#ifndef _
105+#define _(X) (X)
106+#endif
107+
108+#ifndef N_
109+#define N_(X) (X)
110+#endif
111+
112+#ifndef _libc_intl_domainname
113+#define _libc_intl_domainname "libc"
114+#endif
624a0b95
VM
115diff -Naur glibc-2.10.1.orig/include-native/symbol-hacks.h glibc-2.10.1/include-native/symbol-hacks.h
116--- glibc-2.10.1.orig/include-native/symbol-hacks.h 1969-12-31 19:00:00.000000000 -0500
117+++ glibc-2.10.1/include-native/symbol-hacks.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
118@@ -0,0 +1 @@
119+/* Empty */
624a0b95
VM
120diff -Naur glibc-2.10.1.orig/include-native/tls.h glibc-2.10.1/include-native/tls.h
121--- glibc-2.10.1.orig/include-native/tls.h 1969-12-31 19:00:00.000000000 -0500
122+++ glibc-2.10.1/include-native/tls.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
123@@ -0,0 +1,11 @@
124+#ifndef _include_tls_h
125+#define _include_tls_h 1
126+
127+#if USE_TLS && HAVE___THREAD \
128+ && (!defined NOT_IN_libc || defined IS_IN_libpthread)
129+# define USE___THREAD 1
130+#else
131+# define USE___THREAD 0
132+#endif
133+
134+#endif
624a0b95
VM
135diff -Naur glibc-2.10.1.orig/locale/Makefile glibc-2.10.1/locale/Makefile
136--- glibc-2.10.1.orig/locale/Makefile 2005-12-20 01:58:41.000000000 -0500
137+++ glibc-2.10.1/locale/Makefile 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
138@@ -44,6 +44,9 @@
139 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
140 xlocale localename global-locale coll-lookup
141 others = localedef locale
142+ifneq ($(cross-compiling),no)
143+others-native = localedef-native
144+endif
145 #others-static = localedef locale
146 install-bin = localedef locale
147 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
148@@ -81,6 +84,12 @@
149 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
150 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
151
152+ifneq ($(cross-compiling),no)
153+$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
154+$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
155+$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
156+endif
157+
158 C-translit.h: C-translit.h.in gen-translit.pl
159 $(PERL) gen-translit.pl < $< > $@.tmp
160 mv -f $@.tmp $@
624a0b95
VM
161diff -Naur glibc-2.10.1.orig/localedata/Makefile glibc-2.10.1/localedata/Makefile
162--- glibc-2.10.1.orig/localedata/Makefile 2008-11-27 19:05:08.000000000 -0500
163+++ glibc-2.10.1/localedata/Makefile 2009-03-15 19:22:15.939718625 -0400
6dca1d21
JB
164@@ -208,8 +208,13 @@
165 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
166
167 # Sometimes the whole collection of locale files should be installed.
168+ifeq ($(cross-compiling),no)
169 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
170 $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
171+else
172+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
173+$(common-objpfx)locale/localedef-native
174+endif
175 install-locales: $(INSTALL-SUPPORTED-LOCALES)
176
177 install-locales-dir:
624a0b95
VM
178diff -Naur glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
179--- glibc-2.10.1.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400
180+++ glibc-2.10.1/Makeconfig 2009-03-15 19:22:15.939718625 -0400
6dca1d21
JB
181@@ -446,6 +446,13 @@
182 $(common-objpfx)libc% $(+postinit),$^) \
183 $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
184 endif
185+# Command for linking programs against the host system.
186+ifndef +link-native
187++link-native = $(BUILD_CC) -static -g -o $@ $^ \
188+ $(LDFLAGS) $(LDFLAGS-$(@F)) \
189+ $(combreloc-LDFLAGS) $(relro-LDFLAGS) \
190+ $(link-extra-libs)
191+endif
192 # Command for statically linking bounded-pointer programs with the C library.
193 ifndef +link-bounded
194 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
195@@ -659,6 +666,8 @@
196 $(+sysdep-includes) $(includes) \
197 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
198
199++includes-native = -I$(..)include-native -I$(objpfx) -I.
200+
201 # Since libio has several internal header files, we use a -I instead
202 # of many little headers in the include directory.
203 libio-include = -I$(..)libio
204@@ -673,10 +682,15 @@
205 $(foreach lib,$(libof-$(basename $(@F))) \
206 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
207 $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
208+CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
209+ $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
210+ $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
211 override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
212 $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
213 $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
214 $(CFLAGS-$(@F))
215+override CFLAGS-native = -std=gnu99 $(gnu89-inline-CFLAGS) $(default_cflags) $(+gccwarn-c) \
216+ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
217 override CXXFLAGS = $(c++-sysincludes) \
218 $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
219 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
624a0b95
VM
220diff -Naur glibc-2.10.1.orig/Makerules glibc-2.10.1/Makerules
221--- glibc-2.10.1.orig/Makerules 2008-02-06 19:39:18.000000000 -0500
222+++ glibc-2.10.1/Makerules 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
223@@ -278,6 +278,9 @@
224 object-suffixes-left := $(all-object-suffixes)
225 include $(o-iterator)
226
227+$(objpfx)%-native.o: %.c $(before-compile)
228+ $(native-compile-command.c)
229+
230 # Omit the objpfx rules when building in the source tree, because
231 # objpfx is empty and so these rules just override the ones above.
232 ifdef objpfx
233@@ -354,6 +357,8 @@
234 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
235 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
236 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
237+# Native commands
238+native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
239
240 # GCC can grok options after the file name, and it looks nicer that way.
241 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
242@@ -363,6 +368,8 @@
243 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
244 $(ASFLAGS) $(ASFLAGS-$(suffix $@))
245 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
246+# Native commands
247+native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
248
249 # We need this for the output to go in the right place. It will default to
250 # empty if make was configured to work with a cc that can't grok -c and -o
251@@ -1156,7 +1163,7 @@
252 $(make-target-directory)
253 $(patsubst %/,cd % &&,$(objpfx)) \
254 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
255- $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
256+ $(addprefix $(shell pwd)/, $^) -o $(@F)
257 endef
258
259 # Command to compile $< in $(common-objdir) using the native libraries.
624a0b95
VM
260diff -Naur glibc-2.10.1.orig/malloc/Makefile glibc-2.10.1/malloc/Makefile
261--- glibc-2.10.1.orig/malloc/Makefile 2007-12-16 17:57:50.000000000 -0500
262+++ glibc-2.10.1/malloc/Makefile 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
263@@ -73,10 +73,6 @@
264 endif
265 endif
266
267-# Unless we get a test for the availability of libgd which also works
268-# for cross-compiling we disable the memusagestat generation in this
269-# situation.
270-ifneq ($(cross-compiling),yes)
271 # If the gd library is available we build the `memusagestat' program.
272 ifneq ($(LIBGD),no)
273 others: $(objpfx)memusage
274@@ -91,7 +87,6 @@
275 # is to presume that the standard system headers will be ok for this file.
276 $(objpfx)memusagestat.o: sysincludes = # nothing
277 endif
278-endif
279
280 # Another goal which can be used to override the configure decision.
281 .PHONY: do-memusagestat
624a0b95
VM
282diff -Naur glibc-2.10.1.orig/Rules glibc-2.10.1/Rules
283--- glibc-2.10.1.orig/Rules 2006-02-28 02:05:48.000000000 -0500
284+++ glibc-2.10.1/Rules 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
285@@ -87,7 +87,7 @@
286
287 .PHONY: others tests
288 ifeq ($(build-programs),yes)
289-others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
290+others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
291 else
292 others: $(addprefix $(objpfx),$(extra-objs))
293 endif
294@@ -106,9 +106,11 @@
295 ifeq ($(build-programs),yes)
296 binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
297 binaries-static = $(others-static) $(tests-static) $(xtests-static)
298+binaries-native = $(others-native)
299 else
300 binaries-all = $(tests) $(xtests) $(test-srcs)
301 binaries-static =
302+binaries-native =
303 endif
304
305 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
306@@ -127,6 +129,11 @@
307 $(+link-static)
308 endif
309
310+ifneq "$(strip $(binaries-native))" ""
311+$(addprefix $(objpfx),$(binaries-native)): %: %.o
312+ $(+link-native)
313+endif
314+
315 ifeq ($(build-bounded),yes)
316 binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
317 $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
624a0b95
VM
318diff -Naur glibc-2.10.1.orig/sunrpc/Makefile glibc-2.10.1/sunrpc/Makefile
319--- glibc-2.10.1.orig/sunrpc/Makefile 2006-10-18 15:25:38.000000000 -0400
320+++ glibc-2.10.1/sunrpc/Makefile 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
321@@ -70,6 +70,9 @@
322 clnt_unix svc_unix create_xid xdr_intXX_t
323
324 others := rpcinfo
325+ifneq ($(cross-compiling),no)
326+others-native := rpcgen-native
327+endif
328 install-bin := rpcgen
329 install-sbin := rpcinfo
330 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
331@@ -98,15 +101,12 @@
332 $(resolvobjdir)/libresolv.a
333 endif
334
335-ifeq (no,$(cross-compiling))
336-# We can only build this library if we can run the rpcgen we build.
337 headers += $(rpcsvc:%.x=rpcsvc/%.h)
338 extra-libs := librpcsvc
339 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
340 librpcsvc-routines = $(rpcsvc:%.x=x%)
341 librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
342 omit-deps = $(librpcsvc-routines)
343-endif
344
345 CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
346 CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
347@@ -136,13 +136,26 @@
348 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
349 $(+link)
350
351+ifneq ($(cross-compiling),no)
352+rpcgen.c:
353+ touch rpcgen.c
354+
355+$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
356+endif
357+
358 # This makes sure -DNOT_IN_libc is passed for all these modules.
359 cpp-srcs-left := $(rpcgen-objs:.o=.c)
360 lib := nonlib
361 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
362
363 # Tell rpcgen where to find the C preprocessor.
364+ifeq ($(cross-compiling),no)
365 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
366+rpcgen = $(objpfx)rpcgen
367+else
368+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
369+rpcgen = $(objpfx)rpcgen-native
370+endif
371
372 # Install the rpc data base file.
373 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
374@@ -153,7 +166,7 @@
375 # relinked.
376 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
377 @:
378-$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
379+$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
380 $(make-target-directory)
381 -@rm -f ${@:stmp=T} $@
382 $(rpcgen-cmd) -h $< -o ${@:stmp=T}
383@@ -163,7 +176,7 @@
384 # Generate the rpcsvc XDR functions with rpcgen.
385 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
386 @:
387-$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
388+$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
389 -@rm -f ${@:stmp=T} $@
390 $(rpcgen-cmd) -c $< -o ${@:stmp=T}
391 $(move-if-change) $(@:stmp=T) $(@:stmp=c)
624a0b95
VM
392diff -Naur glibc-2.10.1.orig/timezone/Makefile glibc-2.10.1/timezone/Makefile
393--- glibc-2.10.1.orig/timezone/Makefile 2007-07-28 16:33:11.000000000 -0400
394+++ glibc-2.10.1/timezone/Makefile 2009-03-15 19:22:16.056496560 -0400
6dca1d21
JB
395@@ -28,6 +28,9 @@
396 extra-objs := scheck.o ialloc.o
397
398 others := zdump zic
399+ifneq ($(cross-compiling),no)
400+others-native := zic-native
401+endif
402 tests := test-tz tst-timezone
403
404 tzbases := africa antarctica asia australasia europe northamerica \
405@@ -69,13 +72,10 @@
406 $(addprefix $(inst_zonedir)/, \
407 $(posixrules-file)))
408
409-ifeq ($(cross-compiling),no)
410-# Don't try to install the zoneinfo files since we can't run zic.
411 install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
412 $(zonenames:%=posix/%) \
413 $(zonenames:%=right/%)) \
414 $(installed-localtime-file) $(installed-posixrules-file)
415-endif
416
417 ifeq ($(have-ksh),yes)
418 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
419@@ -128,7 +128,11 @@
420 # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
421 # place the output files although $(zonedir) is compiled in. But the
422 # user might have set $(install_root) on the command line of `make install'.
423+ifeq ($(cross-compiling),no)
424 zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
425+else
426+zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
427+endif
428 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
429 -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
430
431@@ -158,8 +162,10 @@
432 $(zic-cmd) -p $(posixrules)
433 endif
434
435-
436 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
437+ifneq ($(cross-compiling),no)
438+$(objpfx)zic-native: $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
439+endif
440
441 tz-cflags = -DTZDIR='"$(zonedir)"' \
442 -DTZDEFAULT='"$(localtime-file)"' \