Re: [PATCHES] Patch to add version numbers to

Bruce Momjian <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.patches
Message-ID <[email protected]>
Tom Lane wrote:
> Bruce Momjian <[email protected]> writes:
> > Tom Lane wrote:
> >> Bruce Momjian <[email protected]> writes:
> >>> One difficulty was generating a new version of libpq.rc at the proper
> >>> time.  I added a prepdist rule just like *.def.  I also added code so
> >>> every time you do a 'make clean' or distclean it does a 'touch' on
> >>> libpq.rc.in so libpq.rc is rebuilt on the next compile.  That seemed
> >>> like the cleanest solution.
> >> 
> >> ... except CVS will not like it at all.  Why don't you just remove the
> >> libpq.rc file instead?
> 
> > I am going to remove libpq.rc from CVS because it is now a derived file
> > from libpq.rc.in.  I don't remove via 'clean' because if someone wants
> > to build VC or BCC and Win32 with the same tarball then once they do a
> > 'clean' they can't do a VC or BCC compile anymore.
> 
> > Does that answer your question?
> 
> Not in the least.
> 
> What I'm complaining about is that you can't simply "touch" a file that
> is under CVS control; CVS will think it's been modified.

Really?  If I touch a file and do a commit I don't see anything happen. 
There might be a problem that cvs is going to check that file over and
over again when it doesn't need to and I certainly don't like the touch
solution.

> Perhaps it would work to make libpq.rc depend on both libpq.rc.in and
> src/Makefile.global; then any re-configure would force it to be rebuilt.

Oh, so make it dependent on a file derived from a configure run.  New
patch attached.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html
/pgpatches/libpqrc (text/plain, 3.4 KB)
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	17 Dec 2004 01:13:38 -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'`';' $(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'`';' $(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	17 Dec 2004 01:13:46 -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/ *$$//' >> $@
  
+ # 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'`'/' < $< > $@
  
  ifneq ($(PTHREAD_H_WIN32), "")
  pthread.h: $(top_srcdir)/src/interfaces/libpq/pthread.h.win
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	17 Dec 2004 01:13:47 -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.