4
4
# Makefile for the timezone library
5
5
6
6
# IDENTIFICATION
7
- # $PostgreSQL: pgsql/src/timezone/Makefile,v 1.17 2004/12/31 19:01:54 tgl Exp $
7
+ # $PostgreSQL: pgsql/src/timezone/Makefile,v 1.18 2005/07/03 18:54:28 petere Exp $
8
8
#
9
9
# -------------------------------------------------------------------------
10
10
@@ -18,7 +18,7 @@ override CPPFLAGS := $(CPPFLAGS)
18
18
OBJS = localtime.o strftime.o pgtz.o
19
19
20
20
# files needed to build zic utility program
21
- ZICOBJS = zic.o ialloc.o scheck.o localtime.o
21
+ ZICOBJS = zic.o ialloc.o scheck.o localtime-zic .o
22
22
23
23
# timezone data files
24
24
TZDATA := africa antarctica asia australasia europe northamerica southamerica \
@@ -30,8 +30,17 @@ all: SUBSYS.o submake-libpgport zic
30
30
SUBSYS.o : $(OBJS )
31
31
$(LD ) $(LDREL ) $(LDOUT ) SUBSYS.o $(OBJS )
32
32
33
+ # In case of cross-compilation, zic needs to be built with a native
34
+ # compiler because it is run during the build, not on the final
35
+ # system.
36
+
37
+ localtime-zic.c : localtime.c
38
+ $(LN_S ) $< $@
39
+
40
+ $(ZICOBJS ) : CC=$(CC_FOR_BUILD )
41
+
33
42
zic : $(ZICOBJS )
34
- $(CC ) $(CFLAGS ) $(ZICOBJS ) $( LDFLAGS ) $( LIBS ) -o $@ $(X )
43
+ $(CC_FOR_BUILD ) $(CFLAGS ) $(ZICOBJS ) -o $@ $(X )
35
44
36
45
install : all installdirs
37
46
./zic -d $(DESTDIR )$(datadir ) /timezone $(TZDATAFILES )
@@ -40,4 +49,4 @@ installdirs:
40
49
$(mkinstalldirs ) $(DESTDIR )$(datadir )
41
50
42
51
clean distclean maintainer-clean :
43
- rm -f SUBSYS.o zic$(X ) $(OBJS ) $(ZICOBJS )
52
+ rm -f SUBSYS.o zic zic $(X ) $(OBJS ) $(ZICOBJS ) localtime-zic.c
0 commit comments