Re: Problems with pgxs - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Problems with pgxs
Date
Msg-id 200410312332.i9VNWwh09009@candle.pha.pa.us
Whole thread Raw
In response to Re: Problems with pgxs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > $(PTHREAD_H_WIN32) is a dependency of libpq and therefore we had to copy
> > it into Makefile.shlib when we are compiling from that file rather than
> > libpq/Makefile.  libpq/Makefile has:
> 
> >   all: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h def-files all-lib
> 
> Say again?  Why should libpq's dependencies be propagated to every shlib
> in the system?  And when is libpq built without using libpq/Makefile?

No idea.  I just know it fixed the problem. The problem report was that
you could not build all-static-lib under MinGW.  I confirmed that using
my MinGW here and developed the following patch:****************** 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.hlib$(NAME).a! all-shared-lib: $(PTHREAD_H_WIN32)
$(top_srcdir)/src/port/pg_config_paths.h$(shlib)  ifneq ($(PORTNAME), cygwin)  ifneq ($(PORTNAME), win32)
 

The problem was that building libpq.a was not generating the include
file dependencies.  The cause I think is that we have a separate Win32
build rule for a static lib in Makefile.shlib:# win32 case$(shlib) lib$(NAME).a: $(OBJS)ifndef DLL_DEFFILE
$(DLLTOOL)--export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)        $(DLLWRAP) $(LDFLAGS_SL) -o $(shlib)
--dllname$(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)        $(DLLTOOL) --dllname $(shlib)
$(DLLTOOL_LIBFLAGS)--def $(NAME).def --output-lib lib$(NAME).aelse        $(DLLWRAP) $(LDFLAGS_SL) -o $(shlib)
--dllname$(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK)        $(DLLTOOL) --dllname $(shlib)
$(DLLTOOL_LIBFLAGS)--def $(DLL_DEFFILE) --output-lib lib$(NAME).aendif
 

and that rule discusses only the OBJ files and doesn't know about the
*.h files that are needed.

Ideas?

--  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,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: horology and DST changeover
Next
From: Bruce Momjian
Date:
Subject: Re: Using ALTER TABLESPACE in pg_dump