Re: [PATCHES] build infrastructure for extensions v3

2004-07-15 Thread Fabien COELHO

Dear Peter,


 I am still opposed to adding more targets of the form light-install,

It is a renaming of the previous 'install' target, as the new install is
the previous 'server-install', so it is no different from the current
status.

I let 'light-install' as a compromise wrt Tom view that the default
installation should not include header files, so that it would be still
easy to do that...

 client-only install, etc.

Ok, as you wish. I just felt it was easy and useful.

 Please discuss this on -hackers. It can be done as a separate patch
 later on if need be.

Ok.

 While I now understand what you are doing in contrib, I ask who is going
 to want to maintain two parallel sets of makefiles, one for PGXS and one
 for in-tree builds?

Yep, that is indeed a good point.

 One who is going to want to use the PGXS ones anyway?

Well, I've been disappointed in the past when I wanted to test a contrib
and had to reconfigure everything to do so. So I really think it is useful
to be able to add contribs as an after-thought.

I really tend to think that there could be the pgxs only version, but that
would break compile without installing, and you don't want that, as
previously discussed.

So there is no perfect solution:-(

What I can do is to enable the current makefiles to use pgxs if desired by
the user, maybe with some switch, say make install vs make USE_PGXS=yes
install...  I'll lose the clean illustration part but would have one
makefile only and still enable using pgxs if needed.


 I realize they're good examples, but examples should be put into the
 documentation, so people can find them.

Humm.

 Paste your documentation (pgxs.sgml) somewhere into xfunc.sgml, where it
 discusses writing user-defined functions.  This material isn't long
 enough to warrant a chapter of its own.

Ok.

 + ifdef PGXS
 + LDFLAGS += -L$(pkglibdir)
 + endif

 needs to disappear.  There is nothing to link with in there.  (If there
 is, that's a bug.)

I think I added it because it did not work without that, but I can recheck
whether it is really needed.

 libpgport should be installed in the normal libdir.

Ok.

I'll submit a new patch on tomorrow to hopefully address all these issues.
Thanks a lot for all these comments,

have a nice day,

-- 
Fabien Coelho - [EMAIL PROTECTED]

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] build infrastructure for extensions v3

2004-07-15 Thread Bruce Momjian

Patch withdrawn by author.

---

Fabien COELHO wrote:
 
 Dear patchers,
 
 Please find attached version number 3 for a patch to enable extensions
 such as contribs or external add-ons to be installed simply with an
 already installed postgresql.
 
 This version addresses Peter's comments about src/makefiles/Makefile.*
 that do not need to be installed. It works for me, as previous versions.
 
 See other comments in previous submissions and responses.
 
 -- 
 Fabien.

Content-Description: 

[ Attachment, skipping... ]

 
 ---(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

---(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] build infrastructure for extensions v3

2004-07-14 Thread Peter Eisentraut
Fabien COELHO wrote:
 Dear patchers,

 Please find attached version number 3 for a patch to enable
 extensions such as contribs or external add-ons to be installed
 simply with an already installed postgresql.

OK, I think we're getting somewhere.

I am still opposed to adding more targets of the form light-install, 
client-only install, etc.  Please discuss this on -hackers.  It can 
be done as a separate patch later on if need be.

While I now understand what you are doing in contrib, I ask who is going 
to want to maintain two parallel sets of makefiles, one for PGXS and 
one for in-tree builds?  One who is going to want to use the PGXS ones 
anyway?  I realize they're good examples, but examples should be put 
into the documentation, so people can find them.

Paste your documentation (pgxs.sgml) somewhere into xfunc.sgml, where it 
discusses writing user-defined functions.  This material isn't long 
enough to warrant a chapter of its own.

+ ifdef PGXS
+ LDFLAGS += -L$(pkglibdir)
+ endif

needs to disappear.  There is nothing to link with in there.  (If there 
is, that's a bug.)

libpgport should be installed in the normal libdir.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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


Re: [PATCHES] build infrastructure for extensions v3

2004-07-10 Thread Peter Eisentraut
Bruce Momjian wrote:
 Wow, that is a big patch.

 Your patch has been added to the PostgreSQL unapplied patches list
 at:

   http://momjian.postgresql.org/cgi-bin/pgpatches

 I will try to apply it within the next 48 hours.

ISTM that this version still does not allow building contrib without 
having installed pg_config first.  That is a no-no.


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


Re: [PATCHES] build infrastructure for extensions v3

2004-07-10 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 ISTM that this version still does not allow building contrib without 
 having installed pg_config first.  That is a no-no.

Sounds like the list of objections is getting shorter anyway ;-).  Do
you feel that this patch is going in basically the right direction?
I've not had any time to look at it myself ...

regards, tom lane

---(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


[PATCHES] build infrastructure for extensions v3

2004-07-05 Thread Fabien COELHO

Dear patchers,

Please find attached version number 3 for a patch to enable extensions
such as contribs or external add-ons to be installed simply with an
already installed postgresql.

This version addresses Peter's comments about src/makefiles/Makefile.*
that do not need to be installed. It works for me, as previous versions.

See other comments in previous submissions and responses.

-- 
Fabien.*** ./GNUmakefile.in.orig   Mon Jun 14 15:33:06 2004
--- ./GNUmakefile.inMon Jul  5 09:24:51 2004
***
*** 13,30 
$(MAKE) -C src all
@echo All of PostgreSQL successfully made. Ready to install.
  
! install:
$(MAKE) -C doc install
$(MAKE) -C src install
-   @echo PostgreSQL installation complete.
  
! installdirs uninstall distprep:
$(MAKE) -C doc $@
$(MAKE) -C src $@
  
  install-all-headers:
$(MAKE) -C src $@
  
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
--- 13,55 
$(MAKE) -C src all
@echo All of PostgreSQL successfully made. Ready to install.
  
! install: light-install install-all-headers install-config-files
!   @echo PostgreSQL installation complete.
! 
! light-install:
$(MAKE) -C doc install
$(MAKE) -C src install
  
! distprep:
$(MAKE) -C doc $@
$(MAKE) -C src $@
  
+ installdirs:
+   $(MAKE) -C doc $@
+   $(MAKE) -C src $@
+   $(MAKE) -C config $@
+   $(mkinstalldirs) $(DESTDIR)$(pgxsdir)
+ 
+ uninstall:
+   $(MAKE) -C doc $@
+   $(MAKE) -C src $@
+   $(MAKE) -C config $@
+   $(DESTDIR)$(pgxsdir)
+ 
  install-all-headers:
$(MAKE) -C src $@
  
+ install-config-files: installdirs
+   $(MAKE) -C src $@
+   $(MAKE) -C config $@
+   $(INSTALL_DATA) config.status $(DESTDIR)$(pgxsdir)
+ 
+ install-client-only:
+   $(MAKE) -C src/bin install
+   $(MAKE) -C src/include install
+   $(MAKE) -C src/interfaces install
+   $(MAKE) -C doc install
+ 
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
*** ./config/Makefile.orig  Mon Jul  5 09:24:51 2004
--- ./config/Makefile   Mon Jul  5 09:24:51 2004
***
*** 0 
--- 1,19 
+ # $PostgreSQL$
+ 
+ subdir = config
+ top_builddir = ..
+ include $(top_builddir)/src/Makefile.global
+ 
+ ins_files = install-sh mkinstalldirs
+ ins_dir   = $(DESTDIR)$(pgxsdir)/config
+ 
+ install-config-files: install
+ 
+ install: installdirs
+   for f in $(ins_files) ; do $(INSTALL_DATA) $$f $(ins_dir) ; done;
+ 
+ installdirs:
+   $(mkinstalldirs) $(ins_dir)
+ 
+ uninstall:
+   for f in $(ins_files) ; do $(RM) $(ins_dir)/$$f ; done;
*** ./contrib/btree_gist/pgxs.mk.orig   Mon Jul  5 09:24:51 2004
--- ./contrib/btree_gist/pgxs.mkMon Jul  5 09:24:51 2004
***
*** 0 
--- 1,28 
+ # local configuration
+ MODULE_big = btree_gist
+ OBJS= btree_common.o btree_int2.o btree_int4.o btree_int8.o btree_float4.o 
btree_float8.o btree_ts.o
+ DATA_built = btree_gist.sql
+ DOCS = README.btree_gist
+ REGRESS = btree_gist
+ 
+ EXTRA_CLEAN = btree_int2.c btree_int4.c btree_int8.c btree_float4.c btree_float8.c 
+ 
+ # generic settings
+ PGXS  := $(shell pg_config --pgxs)
+ include $(PGXS)
+ 
+ # local rules
+ btree_int2.c: btree_num.c.in
+   sed 
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT2,g;s,__BTREE_GIST_TYPE__,int16,g;s,__BTREE_GIST_TYPE2__,int2,g'
  $   $@
+ 
+ btree_int4.c: btree_num.c.in
+   sed 
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT4,g;s,__BTREE_GIST_TYPE__,int32,g;s,__BTREE_GIST_TYPE2__,int4,g'
  $   $@
+ 
+ btree_int8.c: btree_num.c.in
+   sed 
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT8,g;s,__BTREE_GIST_TYPE__,int64,g;s,__BTREE_GIST_TYPE2__,int8,g'
  $   $@
+ 
+ btree_float4.c: btree_num.c.in
+   sed 
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_FLOAT4,g;s,__BTREE_GIST_TYPE__,float4,g;s,__BTREE_GIST_TYPE2__,float4,g'
  $   $@
+ 
+ btree_float8.c: btree_num.c.in
+   sed 
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_FLOAT8,g;s,__BTREE_GIST_TYPE__,float8,g;s,__BTREE_GIST_TYPE2__,float8,g'
  $   $@
*** ./contrib/chkpass/pgxs.mk.orig  Mon Jul  5 09:24:51 2004
--- ./contrib/chkpass/pgxs.mk   Mon Jul  5 09:24:51 2004
***
*** 0 
--- 1,12 
+ # local conf
+ MODULE_big = chkpass
+ OBJS = chkpass.o
+ SHLIB_LINK = $(filter -lcrypt, $(LIBS))
+ DATA_built = chkpass.sql
+ DOCS = README.chkpass
+ 
+ # global
+ PGXS  := $(shell pg_config --pgxs)
+ include $(PGXS)
+ 
+ # local rules
*** ./contrib/cube/pgxs.mk.orig Mon Jul  5 09:24:51 2004
--- ./contrib/cube/pgxs.mk  Mon Jul  5 09:24:51 2004
***
*** 0 
--- 1,35 
+ # generic macros
+ MODULE_big = cube
+ OBJS= cube.o cubeparse.o
+ 
+ DATA_built = cube.sql
+ DOCS = README.cube
+ REGRESS = cube
+ 
+ EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
+ 
+ # postgresql extensions
+ PGXS := $(shell