mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Set up ar, dlltool, dllwrap, and windres for cross-compiling if necessary.
Plus some makefile cleanup. part of a patch from Richard Evans
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# -*-makefile-*-
|
||||
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.247 2008/11/26 11:26:54 petere Exp $
|
||||
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.248 2008/12/07 08:36:22 petere Exp $
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# All PostgreSQL makefiles include this file and use the variables it sets,
|
||||
@ -226,6 +226,9 @@ DTRACEFLAGS = @DTRACEFLAGS@
|
||||
|
||||
# Linking
|
||||
|
||||
AR = @AR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
LIBS = @LIBS@
|
||||
LDAP_LIBS_FE = @LDAP_LIBS_FE@
|
||||
LDAP_LIBS_BE = @LDAP_LIBS_BE@
|
||||
@ -238,6 +241,7 @@ LDFLAGS_SL = @LDFLAGS_SL@
|
||||
LDREL = -r
|
||||
LDOUT = -o
|
||||
RANLIB = @RANLIB@
|
||||
WINDRES = @WINDRES@
|
||||
X = @EXEEXT@
|
||||
|
||||
# Perl
|
||||
@ -466,25 +470,6 @@ TAS = @TAS@
|
||||
%.bz2: %
|
||||
$(BZIP2) -f $<
|
||||
|
||||
ifeq ($(PORTNAME),win32)
|
||||
# Build rules to add versioninfo resources to win32 binaries
|
||||
WIN32RES += win32ver.o
|
||||
ifeq ($(PGFILESHLIB),1)
|
||||
PGFTYPE=VFT_DLL
|
||||
else
|
||||
PGFTYPE=VFT_APP
|
||||
endif
|
||||
ifneq (,$(PGAPPICON))
|
||||
PGICOSTR=$(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
|
||||
endif
|
||||
win32ver.rc: $(top_builddir)/src/port/win32ver.rc
|
||||
sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
|
||||
win32ver.o: $(top_builddir)/src/port/win32ver.rc
|
||||
sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
|
||||
windres -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include
|
||||
rm -f win32ver.rc
|
||||
endif
|
||||
|
||||
ifndef PGXS
|
||||
|
||||
# Remake Makefile.global from Makefile.global.in if the latter
|
||||
|
@ -25,7 +25,7 @@ pgevent.dll: $(OBJS) pgevent.def
|
||||
$(DLLWRAP) --def pgevent.def -o $(NAME) $(OBJS)
|
||||
|
||||
pgmsgevent.o: pgmsgevent.rc win32ver.rc
|
||||
windres pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include
|
||||
$(WINDRES) pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include
|
||||
|
||||
all-lib: $(NAME)
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
# Portions Copyright (c) 1994, Regents of the University of California
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.170 2008/12/02 10:39:30 mha Exp $
|
||||
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.171 2008/12/07 08:36:22 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -44,7 +44,7 @@ ifeq ($(PORTNAME), win32)
|
||||
OBJS += win32.o pgsleep.o libpqrc.o
|
||||
|
||||
libpqrc.o: libpq.rc
|
||||
windres -i $< -o $@
|
||||
$(WINDRES) -i $< -o $@
|
||||
|
||||
ifeq ($(enable_thread_safety), yes)
|
||||
OBJS += pthread-win32.o
|
||||
|
@ -1,10 +1,8 @@
|
||||
# $PostgreSQL: pgsql/src/makefiles/Makefile.win32,v 1.11 2007/08/21 13:32:33 mha Exp $
|
||||
# $PostgreSQL: pgsql/src/makefiles/Makefile.win32,v 1.12 2008/12/07 08:36:22 petere Exp $
|
||||
|
||||
# Use replacement include files for those missing on Win32
|
||||
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
|
||||
|
||||
DLLTOOL= dlltool
|
||||
DLLWRAP= dllwrap
|
||||
ifdef PGXS
|
||||
BE_DLLLIBS= -L$(libdir) -lpostgres
|
||||
else
|
||||
@ -51,3 +49,22 @@ endif
|
||||
ifndef MAKE_DLL
|
||||
MAKE_DLL = true
|
||||
endif
|
||||
|
||||
|
||||
# Build rules to add versioninfo resources to win32 binaries
|
||||
|
||||
WIN32RES += win32ver.o
|
||||
ifeq ($(PGFILESHLIB),1)
|
||||
PGFTYPE = VFT_DLL
|
||||
else
|
||||
PGFTYPE = VFT_APP
|
||||
endif
|
||||
ifneq (,$(PGAPPICON))
|
||||
PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
|
||||
endif
|
||||
|
||||
win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
|
||||
sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $< >$@
|
||||
|
||||
win32ver.o: win32ver.rc
|
||||
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include
|
||||
|
Reference in New Issue
Block a user