Re: [pgsql-hackers-win32] Patch to add version numbers to - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [pgsql-hackers-win32] Patch to add version numbers to
Date
Msg-id 200412190216.iBJ2GUj10171@candle.pha.pa.us
Whole thread Raw
In response to Re: [pgsql-hackers-win32] Patch to add version numbers to  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Applied, version attached.  Magnus tested it.

---------------------------------------------------------------------------

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > + # Force rebuild on re-run of configure
> > > + $(srcdir)/libpq.rc: $(top_srcdir)/src/Makefile.global libpq.rc.in
> > > +     sed -e 's/\(VERSION.*\),0 *$$/\1,'`date '+%y%j'`'/' < $< > $@
> >
> > Put Makefile.global second, else $< refers to the wrong file.
> > Also, it has to be $(top_builddir)/src/Makefile.global, not top_srcdir.
> > The comment would probably be more useful if a little more verbose:
> > # depend on Makefile.global to force rebuild on re-run of configure
>
> OK, new version attached with adjustments.  I do like the
> Makefile.global dependency idea!
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/Makefile.global.in
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.global.in,v
retrieving revision 1.207
diff -c -c -r1.207 Makefile.global.in
*** src/Makefile.global.in    16 Dec 2004 18:13:07 -0000    1.207
--- src/Makefile.global.in    18 Dec 2004 18:19:45 -0000
***************
*** 415,423 ****
  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);'
$(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);'
$(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
--- 415,423 ----
  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
Index: src/interfaces/libpq/Makefile
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v
retrieving revision 1.122
diff -c -c -r1.122 Makefile
*** src/interfaces/libpq/Makefile    20 Nov 2004 21:13:06 -0000    1.122
--- src/interfaces/libpq/Makefile    18 Dec 2004 18:19:52 -0000
***************
*** 59,65 ****
  endif


! all: $(PTHREAD_H_WIN32) def-files all-lib

  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
--- 59,65 ----
  endif


! all: $(PTHREAD_H_WIN32) def-files $(srcdir)/libpq.rc all-lib

  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
***************
*** 118,123 ****
--- 118,126 ----
      echo '; Aliases for MS compatible names' >> $@
      sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1= _\1/' < $< | sed 's/ *$$//' >> $@

+ # depend on Makefile.global to force rebuild on re-run of configure
+ $(srcdir)/libpq.rc: libpq.rc.in $(top_builddir)/src/Makefile.global
+     sed -e 's/\(VERSION.*\),0 *$$/\1,'`date '+%y%j' | sed 's/^0*//'`'/' < $< > $@

  ifneq ($(PTHREAD_H_WIN32), "")
  pthread.h: $(top_srcdir)/src/interfaces/libpq/pthread.h.win
Index: src/interfaces/libpq/libpq.rc
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/libpq.rc,v
retrieving revision 1.12
diff -c -c -r1.12 libpq.rc
*** src/interfaces/libpq/libpq.rc    9 Aug 2004 01:55:42 -0000    1.12
--- src/interfaces/libpq/libpq.rc    18 Dec 2004 18:19:52 -0000
***************
*** 1,8 ****
  #include <winver.h>

  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 8,0,0,0
!  PRODUCTVERSION 8,0,0,0
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS__WINDOWS32
--- 1,8 ----
  #include <winver.h>

  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION 8,0,0,4353
!  PRODUCTVERSION 8,0,0,4353
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS__WINDOWS32
***************
*** 15,27 ****
          BEGIN
              VALUE "CompanyName", "\0"
              VALUE "FileDescription", "PostgreSQL Access Library\0"
!             VALUE "FileVersion", "8, 0, 0, 0\0"
              VALUE "InternalName", "libpq\0"
              VALUE "LegalCopyright", "Copyright (C) 2004\0"
              VALUE "LegalTrademarks", "\0"
              VALUE "OriginalFilename", "libpq.dll\0"
              VALUE "ProductName", "PostgreSQL\0"
!             VALUE "ProductVersion", "8, 0, 0, 0\0"
          END
      END
      BLOCK "VarFileInfo"
--- 15,27 ----
          BEGIN
              VALUE "CompanyName", "\0"
              VALUE "FileDescription", "PostgreSQL Access Library\0"
!             VALUE "FileVersion", "8.0.0\0"
              VALUE "InternalName", "libpq\0"
              VALUE "LegalCopyright", "Copyright (C) 2004\0"
              VALUE "LegalTrademarks", "\0"
              VALUE "OriginalFilename", "libpq.dll\0"
              VALUE "ProductName", "PostgreSQL\0"
!             VALUE "ProductVersion", "8.0.0\0"
          END
      END
      BLOCK "VarFileInfo"
Index: src/port/win32ver.rc
===================================================================
RCS file: /cvsroot/pgsql/src/port/win32ver.rc,v
retrieving revision 1.2
diff -c -c -r1.2 win32ver.rc
*** src/port/win32ver.rc    6 Oct 2004 15:23:27 -0000    1.2
--- src/port/win32ver.rc    18 Dec 2004 18:19:53 -0000
***************
*** 2,9 ****
  #include "pg_config.h"

  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION    8,0,000,000
!  PRODUCTVERSION 8,0,000,000
   FILEFLAGSMASK  0x17L
   FILEFLAGS      0x0L
   FILEOS         VOS_NT_WINDOWS32
--- 2,9 ----
  #include "pg_config.h"

  VS_VERSION_INFO VERSIONINFO
!  FILEVERSION    8,0,0,0
!  PRODUCTVERSION 8,0,0,0
   FILEFLAGSMASK  0x17L
   FILEFLAGS      0x0L
   FILEOS         VOS_NT_WINDOWS32

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Proposed patch for psql backtick safety
Next
From: Bruce Momjian
Date:
Subject: Re: (8.1) to_timestamp correction (epoch to timestamptz)