Re: Problems with pgxs

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Hallgren <thhal(at)mailblocks(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with pgxs
Date: 2004-10-31 23:32:58
Message-ID: 200410312332.i9VNWwh09009@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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.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)

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).a
else
$(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).a
endif

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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-10-31 23:42:36 Re: Using ALTER TABLESPACE in pg_dump
Previous Message Andrew Dunstan 2004-10-31 23:17:57 Re: horology and DST changeover