Re: [PATCHES] [pgsql-hackers-win32] Static build of libpq fails

2004-10-13 Thread Dave Page
 

> -Original Message-
> From: Bruce Momjian [mailto:[EMAIL PROTECTED] 
> Sent: 13 October 2004 10:52
> To: Dave Page
> Cc: [EMAIL PROTECTED]; PostgreSQL-patches; 
> PostgreSQL Cygwin mailing list
> Subject: Re: [pgsql-hackers-win32] Static build of libpq fails
> 
> 
> I was able to reproduce the failure, and the attached applied 
> patch fixes the problem.  Seems someone just disable the 
> libpq.a make rule in Makefile.shlib, probably because it 
> didn't used to work, but it does now.  I am not sure about 
> Cygwin but our build experience so far is that if it works on 
> Win32, it works on Cygwin, so I enabled it for both.
> 

Yup, looks good here on Mingw. Thanks Bruce.

Regards, Dave.

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] [pgsql-hackers-win32] Static build of libpq fails

2004-10-13 Thread Bruce Momjian

I was able to reproduce the failure, and the attached applied patch
fixes the problem.  Seems someone just disable the libpq.a make rule in
Makefile.shlib, probably because it didn't used to work, but it does
now.  I am not sure about Cygwin but our build experience so far is that
if it works on Win32, it works on Cygwin, so I enabled it for both.

---

Dave Page wrote:
>  
> 
> > -Original Message-
> > From: Bruce Momjian [mailto:[EMAIL PROTECTED] 
> > Sent: 12 October 2004 02:08
> > To: Dave Page
> > Cc: [EMAIL PROTECTED]; PostgreSQL-patches
> > Subject: Re: [pgsql-hackers-win32] Static build of libpq fails
> > 
> > Dave Page wrote:
> > > Hi,
> > > 
> > > I tried building a static libpq with Mingw, which it seems doesn't 
> > > work any more:
> > > 
> > > make[3]: *** No rule to make target `libpq.a', needed by 
> > > `all-static-lib'.  Stop.
> > > make[3]: Leaving directory `/cvs/pgsql/src/interfaces/libpq'
> > > make[2]: *** [all] Error 2
> > > make[2]: Leaving directory `/cvs/pgsql/src/interfaces'
> > > make[1]: *** [all] Error 2
> > > make[1]: Leaving directory `/cvs/pgsql/src'
> > > make: *** [all] Error 2
> > > 
> > > I can work around this easily enough, however it should 
> > obviously get 
> > > fixed at some point.
> > 
> > I got it working easily by doing 'gmake all-static-lib' from 
> > the src/interfaces/libpq directory.  Is it supposed to work 
> > somewhere else?
> 
> $ ./configure --disable-shared; make all
> 
> Will fail (and still does with cvs tip). I normally use that on Linux -
> I assume it should also work on Mingw.
> 
> Regards, Dave
> 
> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
>http://archives.postgresql.org
> 

-- 
  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
Index: src/Makefile.shlib
===
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.82
diff -c -c -r1.82 Makefile.shlib
*** src/Makefile.shlib  12 Oct 2004 22:20:17 -  1.82
--- src/Makefile.shlib  13 Oct 2004 09:44:13 -
***
*** 249,257 
  
  all-shared-lib: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h 
$(shlib)
  
- ifneq ($(PORTNAME), cygwin)
- ifneq ($(PORTNAME), win32)
- 
  ifndef LORDER
  MK_NO_LORDER := true
  endif
--- 249,254 
***
*** 264,272 
  endif
$(RANLIB) $@
  
- endif # not win32
- endif # not cygwin
- 
  ifeq ($(enable_shared), yes)
  
  ifneq ($(PORTNAME), win32)
--- 261,266 

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] [pgsql-hackers-win32] Static build of libpq fails

2004-10-12 Thread Dave Page
 

> -Original Message-
> From: Bruce Momjian [mailto:[EMAIL PROTECTED] 
> Sent: 12 October 2004 02:08
> To: Dave Page
> Cc: [EMAIL PROTECTED]; PostgreSQL-patches
> Subject: Re: [pgsql-hackers-win32] Static build of libpq fails
> 
> Dave Page wrote:
> > Hi,
> > 
> > I tried building a static libpq with Mingw, which it seems doesn't 
> > work any more:
> > 
> > make[3]: *** No rule to make target `libpq.a', needed by 
> > `all-static-lib'.  Stop.
> > make[3]: Leaving directory `/cvs/pgsql/src/interfaces/libpq'
> > make[2]: *** [all] Error 2
> > make[2]: Leaving directory `/cvs/pgsql/src/interfaces'
> > make[1]: *** [all] Error 2
> > make[1]: Leaving directory `/cvs/pgsql/src'
> > make: *** [all] Error 2
> > 
> > I can work around this easily enough, however it should 
> obviously get 
> > fixed at some point.
> 
> I got it working easily by doing 'gmake all-static-lib' from 
> the src/interfaces/libpq directory.  Is it supposed to work 
> somewhere else?

$ ./configure --disable-shared; make all

Will fail (and still does with cvs tip). I normally use that on Linux -
I assume it should also work on Mingw.

Regards, Dave


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] [pgsql-hackers-win32] Static build of libpq fails

2004-10-11 Thread Bruce Momjian
Dave Page wrote:
> Hi,
> 
> I tried building a static libpq with Mingw, which it seems doesn't work
> any more:
> 
> make[3]: *** No rule to make target `libpq.a', needed by
> `all-static-lib'.  Stop.
> make[3]: Leaving directory `/cvs/pgsql/src/interfaces/libpq'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/cvs/pgsql/src/interfaces'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/cvs/pgsql/src'
> make: *** [all] Error 2
> 
> I can work around this easily enough, however it should obviously get
> fixed at some point.

I got it working easily by doing 'gmake all-static-lib' from the
src/interfaces/libpq directory.  Is it supposed to work somewhere else?

The attached patch adds some pg_config_paths.h dependencies that are
missing.  I am now wondering if we should have that file generated by
configure, but that defeats the ability to modify Makefile.global to
change settings so I guess we are stuck with what we have currently.

-- 
  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
Index: src/Makefile.shlib
===
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.79
diff -c -c -r1.79 Makefile.shlib
*** src/Makefile.shlib  8 Oct 2004 04:22:59 -   1.79
--- src/Makefile.shlib  12 Oct 2004 00:56:46 -
***
*** 245,253 
  
  all-lib: all-static-lib all-shared-lib
  
! all-static-lib: lib$(NAME).a
  
! all-shared-lib: $(shlib)
  
  ifneq ($(PORTNAME), cygwin)
  ifneq ($(PORTNAME), win32)
--- 245,253 
  
  all-lib: all-static-lib all-shared-lib
  
! all-static-lib: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h 
lib$(NAME).a
  
! all-shared-lib: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h $(shlib)
  
  ifneq ($(PORTNAME), cygwin)
  ifneq ($(PORTNAME), win32)
Index: src/interfaces/ecpg/ecpglib/Makefile
===
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/Makefile,v
retrieving revision 1.26
diff -c -c -r1.26 Makefile
*** src/interfaces/ecpg/ecpglib/Makefile4 Oct 2004 20:36:11 -   1.26
--- src/interfaces/ecpg/ecpglib/Makefile12 Oct 2004 00:56:54 -
***
*** 30,36 
  SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
  
! all: all-lib
  
  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
--- 30,36 
  SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
  
! all: $(top_srcdir)/src/port/pg_config_paths.h all-lib
  
  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
***
*** 46,51 
--- 46,54 
  exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
  
+ $(top_srcdir)/src/port/pg_config_paths.h:
+   $(MAKE) -C $(top_srcdir)/src/port pg_config_paths.h
+ 
  install: all installdirs install-lib
  
  installdirs:
Index: src/interfaces/libpq/Makefile
===
RCS file: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v
retrieving revision 1.115
diff -c -c -r1.115 Makefile
*** src/interfaces/libpq/Makefile   6 Oct 2004 16:42:01 -   1.115
--- src/interfaces/libpq/Makefile   12 Oct 2004 00:56:54 -
***
*** 31,43 
$(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o, 
$(LIBOBJS))
  
  ifeq ($(PORTNAME), win32)
! OBJS+=win32.o libpqrc.o
! libpqrc.o: libpq.rc
windres -i libpq.rc -o libpqrc.o
  ifeq ($(enable_thread_safety), yes)
  # This doesn't work yet because configure test fails.  2004-06-19
! OBJS+=pthread-win32.o
! PTHREAD_H_WIN32=yes
  endif
  endif
  
--- 31,43 
$(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o, 
$(LIBOBJS))
  
  ifeq ($(PORTNAME), win32)
! OBJS += win32.o libpqrc.o
! libpqrc.o : libpq.rc
windres -i libpq.rc -o libpqrc.o
  ifeq ($(enable_thread_safety), yes)
  # This doesn't work yet because configure test fails.  2004-06-19
! OBJS += pthread-win32.o
! PTHREAD_H_WIN32 = yes
  endif
  endif
  
***
*** 51,57 
  endif
  
  
! all: $(PTHREAD_H_WIN32) all-lib
  
  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
--- 51,57 
  endif
  
  
! all: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h all-lib
  
  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
***
*** 83,88 
--- 83,91 
rm -f $@ && $(LN_S) $< .
  endif
  
+ $(top_srcdir)/src/port/pg_config_paths.h:
+   $(MAKE) -C $(top_srcdir)/src/port pg_config_paths.h
+ 
  install: all installdirs install-lib