[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [HACKERS] Problems with pgxs
From:       Bruce Momjian <pgman () candle ! pha ! pa ! us>
Date:       2004-10-31 23:32:58
Message-ID: 200410312332.i9VNWwh09009 () candle ! pha ! pa ! us
[Download RAW message or body]

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.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@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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic