mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Support cross compilation by compiling "zic" with a native compiler. This
relies on the output of zic being platform independent, but that is currently the case.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# Makefile for the timezone library
|
||||
|
||||
# IDENTIFICATION
|
||||
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.17 2004/12/31 19:01:54 tgl Exp $
|
||||
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.18 2005/07/03 18:54:28 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@ override CPPFLAGS := $(CPPFLAGS)
|
||||
OBJS= localtime.o strftime.o pgtz.o
|
||||
|
||||
# files needed to build zic utility program
|
||||
ZICOBJS= zic.o ialloc.o scheck.o localtime.o
|
||||
ZICOBJS= zic.o ialloc.o scheck.o localtime-zic.o
|
||||
|
||||
# timezone data files
|
||||
TZDATA := africa antarctica asia australasia europe northamerica southamerica \
|
||||
@@ -30,8 +30,17 @@ all: SUBSYS.o submake-libpgport zic
|
||||
SUBSYS.o: $(OBJS)
|
||||
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
|
||||
|
||||
# In case of cross-compilation, zic needs to be built with a native
|
||||
# compiler because it is run during the build, not on the final
|
||||
# system.
|
||||
|
||||
localtime-zic.c: localtime.c
|
||||
$(LN_S) $< $@
|
||||
|
||||
$(ZICOBJS): CC=$(CC_FOR_BUILD)
|
||||
|
||||
zic: $(ZICOBJS)
|
||||
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
|
||||
$(CC_FOR_BUILD) $(CFLAGS) $(ZICOBJS) -o $@$(X)
|
||||
|
||||
install: all installdirs
|
||||
./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES)
|
||||
@@ -40,4 +49,4 @@ installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
||||
|
||||
clean distclean maintainer-clean:
|
||||
rm -f SUBSYS.o zic$(X) $(OBJS) $(ZICOBJS)
|
||||
rm -f SUBSYS.o zic zic$(X) $(OBJS) $(ZICOBJS) localtime-zic.c
|
||||
|
Reference in New Issue
Block a user