[c0c7dbe2] | 1 | Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
|
---|
| 2 | Date: 2005-07-20
|
---|
| 3 | Initial Package Version: 2.4
|
---|
| 4 | Origin: Joe Ciccone
|
---|
| 5 | Upstream Status: Unknown
|
---|
| 6 | Description: Allows the timezone data to be installed when cross-compiling
|
---|
| 7 | by building and using zic-host.
|
---|
| 8 |
|
---|
| 9 | diff -Naur glibc-2.4.orig/timezone/Makefile glibc-2.4/timezone/Makefile
|
---|
| 10 | --- glibc-2.4.orig/timezone/Makefile 2005-04-15 16:09:08.000000000 -0400
|
---|
| 11 | +++ glibc-2.4/timezone/Makefile 2006-06-18 11:55:46.000000000 -0400
|
---|
| 12 | @@ -28,6 +28,9 @@
|
---|
| 13 | extra-objs := scheck.o ialloc.o
|
---|
| 14 |
|
---|
| 15 | others := zdump zic
|
---|
| 16 | +ifneq ($(cross-compiling),no)
|
---|
| 17 | +others += zic-host
|
---|
| 18 | +endif
|
---|
| 19 | tests := test-tz tst-timezone
|
---|
| 20 |
|
---|
| 21 | tzbases := africa antarctica asia australasia europe northamerica \
|
---|
| 22 | @@ -49,6 +52,7 @@
|
---|
| 23 | include ../Makeconfig # Get objpfx defined so we can use it below.
|
---|
| 24 |
|
---|
| 25 | CPPFLAGS-zic = -DNOT_IN_libc
|
---|
| 26 | +CPPFLAGS-zic-host = -DNOT_IN_libc
|
---|
| 27 |
|
---|
| 28 | # z.* use this variable.
|
---|
| 29 | define nl
|
---|
| 30 | @@ -69,13 +73,10 @@
|
---|
| 31 | $(addprefix $(inst_zonedir)/, \
|
---|
| 32 | $(posixrules-file)))
|
---|
| 33 |
|
---|
| 34 | -ifeq ($(cross-compiling),no)
|
---|
| 35 | -# Don't try to install the zoneinfo files since we can't run zic.
|
---|
| 36 | install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
|
---|
| 37 | $(zonenames:%=posix/%) \
|
---|
| 38 | $(zonenames:%=right/%)) \
|
---|
| 39 | $(installed-localtime-file) $(installed-posixrules-file)
|
---|
| 40 | -endif
|
---|
| 41 |
|
---|
| 42 | ifeq ($(have-ksh),yes)
|
---|
| 43 | install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
|
---|
| 44 | @@ -85,7 +86,6 @@
|
---|
| 45 |
|
---|
| 46 | include ../Rules
|
---|
| 47 |
|
---|
| 48 | -
|
---|
| 49 | $(tzfiles:%=$(objpfx)z.%): $(objpfx)z.%: % Makefile
|
---|
| 50 | # Kludge alert: we use an implicit rule (in what we are generating here)
|
---|
| 51 | # because that is the only way to tell Make that the one command builds all
|
---|
| 52 | @@ -124,11 +124,14 @@
|
---|
| 53 | echo-zonenames:
|
---|
| 54 | @echo 'Known zones: $(zonenames)'
|
---|
| 55 |
|
---|
| 56 | -
|
---|
| 57 | # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
|
---|
| 58 | # place the output files although $(zonedir) is compiled in. But the
|
---|
| 59 | # user might have set $(install_root) on the command line of `make install'.
|
---|
| 60 | +ifeq ($(cross-compiling),no)
|
---|
| 61 | zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
|
---|
| 62 | +else
|
---|
[2a85a99] | 63 | +zic-cmd = $(common-objpfx)/timezone/zic-host -d $(inst_zonedir)
|
---|
[c0c7dbe2] | 64 | +endif
|
---|
| 65 | tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
|
---|
| 66 | -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
|
---|
| 67 |
|
---|
| 68 | @@ -158,6 +161,14 @@
|
---|
| 69 | $(zic-cmd) -p $(posixrules)
|
---|
| 70 | endif
|
---|
| 71 |
|
---|
| 72 | +zic-host.c scheck-host.c ialloc-host.c: $($@:%-host=%)
|
---|
| 73 | + ln -sf $(@:%-host.c=%.c) $@
|
---|
| 74 | +
|
---|
| 75 | +zic-host-CFLAGS = -O $(CFLAGS-zic.c) \
|
---|
| 76 | + $(firstword $(filter /%,scheck-host.c $(shell pwd)/scheck-host.c)) \
|
---|
| 77 | + $(firstword $(filter /%,ialloc-host.c $(shell pwd)/ialloc-host.c))
|
---|
| 78 | +$(objpfx)zic-host: zic-host.c scheck-host.c ialloc-host.c
|
---|
| 79 | + $(native-compile)
|
---|
| 80 |
|
---|
| 81 | $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
|
---|
| 82 |
|
---|