summaryrefslogtreecommitdiff
path: root/package/tzdata/patches/patch-Makefile
blob: faf30fcd9607799bee5006d5a5e19c5c30717dbd (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
--- w-tzdata-2019c-1.orig/Makefile	2019-07-01 09:06:38.000000000 +0200
+++ w-tzdata-2019c-1/Makefile	2020-02-04 09:33:12.012662611 +0100
@@ -365,7 +365,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fn
 # January's first Monday 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 release 2012h and earlier.
@@ -380,7 +380,7 @@ LEAPSECONDS=
 # The zic command and its arguments.
 
 zic=		./zic
-ZIC=		$(zic) $(ZFLAGS)
+ZIC=		./zic_for_build $(ZFLAGS)
 
 # To shrink the size of installed TZif files,
 # append "-r @N" to omit data before N-seconds-after-the-Epoch.
@@ -579,7 +579,7 @@ SHELL=		/bin/sh
 all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
 		  vanguard.zi main.zi rearguard.zi
 
-ALL:		all date $(ENCHILADA)
+ALL:		zic_for_build date $(ENCHILADA)
 
 install:	all $(DATA) $(REDO) $(MANS)
 		mkdir -p '$(DESTDIR)$(BINDIR)' \
@@ -646,6 +646,12 @@ zdump:		$(TZDOBJS)
 zic:		$(TZCOBJS)
 		$(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) $(CFLAGS_FOR_BUILD) -o $@ zic_build.o localtime_build.o asctime_build.o
+
 yearistype:	yearistype.sh
 		cp yearistype.sh yearistype
 		chmod +x yearistype