Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit da67c91

Browse files
committed
Add Win32 version info to client binaries.
Magnus Hagander
1 parent abef6b5 commit da67c91

File tree

14 files changed

+91
-28
lines changed

14 files changed

+91
-28
lines changed

src/Makefile.global.in

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.196 2004/10/01 02:06:52 neilc Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.197 2004/10/05 19:30:19 momjian Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -386,6 +386,23 @@ TAS = @TAS@
386386
%.bz2: %
387387
$(BZIP2) -f $<
388388

389+
ifeq ($(PORTNAME),win32)
390+
# Build rules to add versioninfo resources to win32 binaries
391+
WIN32RES += win32ver.o
392+
ifeq ($(PGFILESHLIB),1)
393+
PGFTYPE=VFT_DLL
394+
else
395+
PGFTYPE=VFT_APP
396+
endif
397+
ifneq (,$(PGAPPICON))
398+
PGICOSTR=$(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
399+
endif
400+
win32ver.rc: $(top_builddir)/src/port/win32ver.rc
401+
sed -e "s;FILEDESC;$(PGFILEDESC);" -e "s/VFT_APP/$(PGFTYPE)/" -e "s/_ICO_/$(PGICOSTR)/" $(top_builddir)/src/port/win32ver.rc > win32ver.rc
402+
win32ver.o: win32ver.rc
403+
windres -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include
404+
rm -f win32ver.rc
405+
endif
389406

390407
ifndef PGXS
391408

src/backend/Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.105 2004/10/04 13:43:54 momjian Exp $
7+
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.106 2004/10/05 19:30:20 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

11+
PGFILEDESC = "PostgreSQL Database Backend"
1112
subdir = src/backend
1213
top_builddir = ../..
1314
include $(top_builddir)/src/Makefile.global
@@ -60,11 +61,11 @@ endif # cygwin
6061

6162
ifeq ($(PORTNAME), win32)
6263

63-
postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a
64+
postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a $(WIN32RES)
6465
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
65-
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(LIBS)
66+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(WIN32RES) $(LIBS)
6667
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
67-
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(LIBS)
68+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
6869
rm -f $@.exp $@.base
6970

7071
postgres.def: $(OBJS)

src/bin/initdb/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.46 2004/10/04 18:05:53 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.47 2004/10/05 19:30:21 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

12+
PGFILEDESC = "initdb - initialize a new database cluster"
1213
subdir = src/bin/initdb
1314
top_builddir = ../../..
1415
include $(top_builddir)/src/Makefile.global
1516

1617
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
1718

18-
OBJS= initdb.o
19+
OBJS= initdb.o $(WIN32RES)
1920

2021
all: submake-libpq submake-libpgport initdb
2122

src/bin/pg_controldata/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
#
55
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.10 2004/10/04 13:43:55 momjian Exp $
7+
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.11 2004/10/05 19:30:21 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

11+
PGFILEDESC = "pg_controldata - reads the data from pg_control"
1112
subdir = src/bin/pg_controldata
1213
top_builddir = ../../..
1314
include $(top_builddir)/src/Makefile.global
1415

1516
override CPPFLAGS += -DFRONTEND
1617

17-
OBJS= pg_controldata.o pg_crc.o
18+
OBJS= pg_controldata.o pg_crc.o $(WIN32RES)
1819

1920
all: submake-libpgport pg_controldata
2021

src/bin/pg_ctl/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.17 2004/10/04 18:05:54 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.18 2004/10/05 19:30:22 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

12+
PGFILEDESC = "pg_ctl - starts/stops/restarts the PostgreSQL server"
1213
subdir = src/bin/pg_ctl
1314
top_builddir = ../../..
1415
include $(top_builddir)/src/Makefile.global
1516

1617
override CPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
1718

18-
OBJS= pg_ctl.o
19+
OBJS= pg_ctl.o $(WIN32RES)
1920

2021
all: submake-libpq submake-libpgport pg_ctl
2122

src/bin/pg_dump/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.55 2004/10/04 20:32:58 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.56 2004/10/05 19:30:23 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

12+
PGFILEDESC = "pg_dump/pg_restore/pg_dumpall - backup and restore PostgreSQL databases"
1213
subdir = src/bin/pg_dump
1314
top_builddir = ../../..
1415
include $(top_builddir)/src/Makefile.global
@@ -17,7 +18,7 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
1718

1819
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
1920
pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
20-
dumputils.o
21+
dumputils.o $(WIN32RES)
2122

2223
EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
2324

@@ -35,7 +36,7 @@ pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
3536
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
3637

3738
pg_dumpall: pg_dumpall.o dumputils.o $(libpq_builddir)/libpq.a
38-
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
39+
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(WIN32RES) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
3940

4041
.PHONY: submake-backend
4142
submake-backend:

src/bin/pg_resetxlog/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
#
55
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.12 2004/10/04 13:43:57 momjian Exp $
7+
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.13 2004/10/05 19:30:23 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

11+
PGFILEDESC = "pg_resetxlog - reset PostgreSQL WAL log"
1112
subdir = src/bin/pg_resetxlog
1213
top_builddir = ../../..
1314
include $(top_builddir)/src/Makefile.global
1415

1516
override CPPFLAGS += -DFRONTEND
1617

17-
OBJS= pg_resetxlog.o pg_crc.o
18+
OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES)
1819

1920
all: submake-libpgport pg_resetxlog
2021

src/bin/pgevent/Makefile

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#
77
#-------------------------------------------------------------------------
88

9+
PGFILEDESC = "Eventlog message formatter"
10+
PGFILESHLIB = 1
911
subdir = src/bin/pgevent
1012
top_builddir = ../../..
1113
include $(top_builddir)/src/Makefile.global
@@ -20,19 +22,19 @@ install: all install-lib
2022
pgevent.dll: $(OBJS) pgevent.def
2123
dllwrap --def pgevent.def -o $(NAME) $(OBJS)
2224

23-
pgmsgevent.o: pgmsgevent.rc
24-
windres pgmsgevent.rc -o pgmsgevent.o
25+
pgmsgevent.o: pgmsgevent.rc win32ver.rc
26+
windres pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include
2527

2628
all-lib: $(NAME)
2729

2830
install-lib: $(NAME)
2931
$(INSTALL_STLIB) $< $(DESTDIR)$(libdir)/$<
30-
32+
3133
uninstall-lib:
3234
rm -f $(DESTDIR)$(libdir)/$(NAME)
3335

3436
clean distclean:
35-
rm -f $(OBJS) $(NAME)
37+
rm -f $(OBJS) $(NAME) win32ver.rc
3638

3739
clean-lib:
3840
rm -f $(NAME)

src/bin/pgevent/pgmsgevent.rc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
LANGUAGE 0x9,0x1
22
1 11 MSG00001.bin
3+
4+
#include "win32ver.rc"

src/bin/psql/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.50 2004/10/04 20:36:10 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.51 2004/10/05 19:30:24 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

12+
PGFILEDESC = "psql - the PostgreSQL interactive terminal"
13+
PGAPPICON=win32
1214
subdir = src/bin/psql
1315
top_builddir = ../../..
1416
include $(top_builddir)/src/Makefile.global
@@ -19,7 +21,7 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
1921

2022
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
2123
startup.o prompt.o variables.o large_obj.o print.o describe.o \
22-
psqlscan.o tab-complete.o mbprint.o
24+
psqlscan.o tab-complete.o mbprint.o $(WIN32RES)
2325

2426
FLEXFLAGS = -Cfe
2527

src/bin/scripts/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.30 2004/10/04 18:05:55 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.31 2004/10/05 19:30:25 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

12+
PGFILEDESC = "PostgreSQL utility"
1213
subdir = src/bin/scripts
1314
top_builddir = ../../..
1415
include $(top_builddir)/src/Makefile.global
@@ -19,7 +20,7 @@ override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/
1920

2021
all: submake-libpq submake-backend $(PROGRAMS)
2122

22-
%: %.o
23+
%: %.o $(WIN32RES)
2324
$(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
2425

2526
createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
@@ -61,5 +62,5 @@ uninstall:
6162

6263
clean distclean maintainer-clean:
6364
rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS))
64-
rm -f common.o dumputils.o print.o mbprint.o
65+
rm -f common.o dumputils.o print.o mbprint.o $(WIN32RES)
6566
rm -f dumputils.c print.c mbprint.c

src/interfaces/ecpg/preproc/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#
55
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.108 2004/10/04 13:43:58 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.109 2004/10/05 19:30:25 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

11+
PGFILEDESC = "ecpg - embedded SQL precompiler for C"
1112
subdir = src/interfaces/ecpg/preproc
1213
top_builddir = ../../../..
1314
include $(top_builddir)/src/Makefile.global
@@ -25,8 +26,9 @@ override CFLAGS += -Wno-error
2526
endif
2627
override CFLAGS += $(PTHREAD_CFLAGS)
2728

28-
OBJS= preproc.o type.o ecpg.o ecpg_keywords.o output.o\
29-
keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o
29+
OBJS= preproc.o type.o ecpg.o ecpg_keywords.o output.o \
30+
keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o \
31+
$(WIN32RES)
3032

3133
all: submake-libpgport ecpg
3234

src/port/win32.ico

22 KB
Binary file not shown.

src/port/win32ver.rc

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <winver.h>
2+
#include "pg_config.h"
3+
4+
VS_VERSION_INFO VERSIONINFO
5+
FILEVERSION 7,4,999,999
6+
PRODUCTVERSION 7,4,999,999
7+
FILEFLAGSMASK 0x17L
8+
FILEFLAGS 0x0L
9+
FILEOS VOS_NT_WINDOWS32
10+
FILETYPE VFT_APP
11+
FILESUBTYPE 0x0L
12+
BEGIN
13+
BLOCK "StringFileInfo"
14+
BEGIN
15+
BLOCK "000004b0"
16+
BEGIN
17+
VALUE "CompanyName", "PostgreSQL Global Development Group"
18+
VALUE "FileDescription", FILEDESC
19+
VALUE "FileVersion", PG_VERSION
20+
VALUE "LegalCopyright", "Portions Copyright (C) 1996-2004 PostgreSQL Global Development Group. Portions Copyright (C) 1994, Regents of the University of California."
21+
VALUE "ProductName", "PostgreSQL"
22+
VALUE "ProductVersion", PG_VERSION
23+
END
24+
END
25+
BLOCK "VarFileInfo"
26+
BEGIN
27+
VALUE "Translation", 0x0, 1200
28+
END
29+
END
30+
31+
_ICO_

0 commit comments

Comments
 (0)