summaryrefslogtreecommitdiff
path: root/package/tzdata/patches/patch-Makefile
blob: ed1bba3241689d6e8dd239499b6f9b595d6c356b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
--- w-tzdata-2014d-1.orig/Makefile	2014-05-28 06:35:46.000000000 +0200
+++ w-tzdata-2014d-1/Makefile	2014-05-30 09:15:54.792171067 +0200
@@ -45,33 +45,33 @@ POSIXRULES=	America/New_York
 
 # Everything gets put in subdirectories of. . .
 
-TOPDIR=		/usr/local
+TZTOPDIR=	/usr
 
 # "Compiled" time zone information is placed in the "TZDIR" directory
 # (and subdirectories).
 # Use an absolute path name for TZDIR unless you're just testing the software.
 
 TZDIR_BASENAME=	zoneinfo
-TZDIR=		$(TOPDIR)/etc/$(TZDIR_BASENAME)
+TZDIR=		$(TZTOPDIR)/etc/$(TZDIR_BASENAME)
 
 # Types to try, as an alternative to time_t.  int64_t should be first.
 TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
 
 # The "tzselect", "zic", and "zdump" commands get installed in. . .
 
-ETCDIR=		$(TOPDIR)/etc
+ETCDIR=		$(TZTOPDIR)/etc
 
 # If you "make INSTALL", the "date" command gets installed in. . .
 
-BINDIR=		$(TOPDIR)/bin
+BINDIR=		$(TZTOPDIR)/bin
 
 # Manual pages go in subdirectories of. . .
 
-MANDIR=		$(TOPDIR)/man
+MANDIR=		$(TZTOPDIR)/man
 
 # Library functions are put in an archive in LIBDIR.
 
-LIBDIR=		$(TOPDIR)/lib
+LIBDIR=		$(TZTOPDIR)/lib
 
 # If you always want time values interpreted as "seconds since the epoch
 # (not counting leap seconds)", use
@@ -224,7 +224,7 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-co
 # before the first Monday in January when a "%V" format is used and January 1
 # falls on a Friday, Saturday, or Sunday.
 
-CFLAGS=
+CFLAGS?=
 
 # Linker flags.  Default to $(LFLAGS) for backwards compatibility
 # to tzcode2012h and earlier.
@@ -232,7 +232,7 @@ CFLAGS=
 LDFLAGS=	$(LFLAGS)
 
 zic=		./zic
-ZIC=		$(zic) $(ZFLAGS)
+ZIC=		./zic_for_build $(ZFLAGS)
 
 ZFLAGS=
 
@@ -338,7 +338,7 @@ SHELL=		/bin/sh
 
 all:		tzselect zic zdump libtz.a $(TABDATA)
 
-ALL:		all date
+ALL:		zic_for_build date
 
 install:	all $(DATA) $(REDO) $(MANS)
 		mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
@@ -371,6 +371,14 @@ zdump:		$(TZDOBJS)
 zic:		$(TZCOBJS) yearistype
 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
 
+zic_for_build: version.h
+		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) zic.c -o zic_build.o
+		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) localtime.c -o localtime_build.o
+		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) asctime.c -o asctime_build.o
+		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) scheck.c -o scheck_build.o
+		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) ialloc.c -o ialloc_build.o
+		$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ zic_build.o localtime_build.o asctime_build.o scheck_build.o ialloc_build.o 
+
 yearistype:	yearistype.sh
 		cp yearistype.sh yearistype
 		chmod +x yearistype
@@ -378,11 +386,11 @@ yearistype:	yearistype.sh
 leapseconds:	$(LEAP_DEPS)
 		$(AWK) -f leapseconds.awk leap-seconds.list >$@
 
-posix_only:	zic $(TDATA)
+posix_only:	zic_for_build $(TDATA)
 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
 			-L /dev/null $(TDATA)
 
-right_only:	zic leapseconds $(TDATA)
+right_only:	zic_for_build leapseconds $(TDATA)
 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
 			-L leapseconds $(TDATA)
 
@@ -520,7 +528,7 @@ check_time_t_alternatives:
 		for type in $(TIME_T_ALTERNATIVES); do \
 		  mkdir -p tzpublic/$$type && \
 		  make clean_misc && \
-		  make TOPDIR=`pwd`/tzpublic/$$type \
+		  make TZTOPDIR=`pwd`/tzpublic/$$type \
 		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
 		    install && \
 		  diff -qr tzpublic/int64_t/etc/zoneinfo tzpublic/$$type/etc/zoneinfo && \