source: clfs-sysroot/patches/glibc-2.4-crosscompile_timezone_fix-1.patch@ de17e85

Last change on this file since de17e85 was 3035090, checked in by Jim Gifford <clfs@…>, 18 years ago

Moved 2.0 patches into the clfs-2.0 trunk

  • Property mode set to 100644
File size: 2.6 KB
  • timezone/Makefile

    Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
    Date: 2005-07-20
    Initial Package Version: 2.4
    Origin: Joe Ciccone
    Upstream Status: Unknown
    Description: Allows the timezone data to be installed when cross-compiling
                 by building and using zic-host.
    
    diff -Naur glibc-2.4.orig/timezone/Makefile glibc-2.4/timezone/Makefile
    old new  
    2828extra-objs := scheck.o ialloc.o
    2929
    3030others  := zdump zic
     31ifneq ($(cross-compiling),no)
     32others  += zic-host
     33endif
    3134tests   := test-tz tst-timezone
    3235
    3336tzbases := africa antarctica asia australasia europe northamerica \
     
    4952include ../Makeconfig   # Get objpfx defined so we can use it below.
    5053
    5154CPPFLAGS-zic = -DNOT_IN_libc
     55CPPFLAGS-zic-host = -DNOT_IN_libc
    5256
    5357# z.* use this variable.
    5458define nl
     
    6973                                         $(addprefix $(inst_zonedir)/, \
    7074                                                     $(posixrules-file)))
    7175
    72 ifeq ($(cross-compiling),no)
    73 # Don't try to install the zoneinfo files since we can't run zic.
    7476install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
    7577                                              $(zonenames:%=posix/%) \
    7678                                              $(zonenames:%=right/%)) \
    7779                 $(installed-localtime-file) $(installed-posixrules-file)
    78 endif
    7980
    8081ifeq ($(have-ksh),yes)
    8182install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
     
    8586
    8687include ../Rules
    8788
    88 
    8989$(tzfiles:%=$(objpfx)z.%): $(objpfx)z.%: % Makefile
    9090# Kludge alert: we use an implicit rule (in what we are generating here)
    9191# because that is the only way to tell Make that the one command builds all
     
    124124echo-zonenames:
    125125        @echo 'Known zones: $(zonenames)'
    126126
    127 
    128127# We have to use `-d $(inst_zonedir)' to explictly tell zic where to
    129128# place the output files although $(zonedir) is compiled in.  But the
    130129# user might have set $(install_root) on the command line of `make install'.
     130ifeq ($(cross-compiling),no)
    131131zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
     132else
     133zic-cmd = $(common-objpfx)/timezone/zic-host -d $(inst_zonedir)
     134endif
    132135tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
    133136            -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
    134137
     
    158161        $(zic-cmd) -p $(posixrules)
    159162endif
    160163
     164zic-host.c scheck-host.c ialloc-host.c: $($@:%-host=%)
     165        ln -sf $(@:%-host.c=%.c) $@
     166
     167zic-host-CFLAGS = -O $(CFLAGS-zic.c) \
     168        $(firstword $(filter /%,scheck-host.c $(shell pwd)/scheck-host.c)) \
     169        $(firstword $(filter /%,ialloc-host.c $(shell pwd)/ialloc-host.c))
     170$(objpfx)zic-host: zic-host.c scheck-host.c ialloc-host.c
     171        $(native-compile)
    161172
    162173$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
    163174
Note: See TracBrowser for help on using the repository browser.