Commit b2971e20 authored by Peter Eisentraut's avatar Peter Eisentraut

Set up ar, dlltool, dllwrap, and windres for cross-compiling if necessary.

Plus some makefile cleanup.

part of a patch from Richard Evans
parent ff1ea217
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.575 2008/12/02 10:39:30 mha Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.576 2008/12/07 08:36:21 petere Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
......@@ -817,6 +817,12 @@ case $host_os in sysv5*)
esac
AC_PROG_RANLIB
PGAC_CHECK_STRIP
AC_CHECK_TOOL(AR, ar, ar)
if test "$PORTNAME" = "win32"; then
AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
AC_CHECK_TOOL(DLLWRAP, dllwrap, dllwrap)
AC_CHECK_TOOL(WINDRES, windres, windres)
fi
AC_PATH_PROG(TAR, tar)
AC_PROG_LN_S
......
# -*-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
......
# $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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment