Hi guys,

The fulltextindex Makefile looks like this:

subdir = contrib/fulltextindex
top_builddir = ../..
include $(top_builddir)/src/Makefile.global

MODULE_big = fti
OBJS = list.o chtbl.o fti.o
DATA_built = fti.sql
DOCS = README.fti
SCRIPTS = fti.pl

include $(top_srcdir)/contrib/contrib-global.mk

How can I modify it to build two different C files into two different .so's?

I want to have fti.so and fti2.so sort of thing...

Chris


Wed, 14 Aug 2002 16:31:28 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
contrib Makefiles
Christopher Kings-Lynne writes:

> How can I modify it to build two different C files into two different .so's?

That is next to impossible in the current setup.

-- 
Peter Eisentraut   peter_e@gmx.net


Thu, 15 Aug 2002 00:02:07 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: contrib Makefiles
Is it possible to have two different functions in the .so that can be made
into two different postgres funtions, both referencing the same .so?

Chris

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
> Sent: Thursday, 15 August 2002 6:02 AM
> To: Christopher Kings-Lynne
> Cc: Hackers
> Subject: Re: [HACKERS] contrib Makefiles
>
>
> Christopher Kings-Lynne writes:
>
> > How can I modify it to build two different C files into two
> different .so's?
>
> That is next to impossible in the current setup.
>
> --
> Peter Eisentraut   peter_e@gmx.net
>


Thu, 15 Aug 2002 12:43:58 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: contrib Makefiles
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Is it possible to have two different functions in the .so that can be made
> into two different postgres funtions, both referencing the same .so?

Certainly, what's the problem there?  Offhand I can't think of any
contrib modules that only define one function...

			regards, tom lane

Thu, 15 Aug 2002 01:09:26 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: contrib Makefiles 
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > Is it possible to have two different functions in the .so that
> can be made
> > into two different postgres funtions, both referencing the same .so?
>
> Certainly, what's the problem there?  Offhand I can't think of any
> contrib modules that only define one function...

OK then,

I guess my question would be that currently fulltextindex generates SQL like
this:

create function fti() returns opaque as
        '$libdir/fti'
        language 'C';

So it references the fti.so, but where does it say what function to actually
run in fti.so?  Or is it assumed in C functions that the function to call in
the shared object is the same as the name of the function???

Chris


Thu, 15 Aug 2002 13:21:21 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: contrib Makefiles 
Christopher Kings-Lynne wrote:
> create function fti() returns opaque as
>         '$libdir/fti'
>         language 'C';
> 
> So it references the fti.so, but where does it say what function to actually
> run in fti.so?  Or is it assumed in C functions that the function to call in
> the shared object is the same as the name of the function???
> 

It does if you're not specific. Take a look at dblink.sql.in. All of the 
dblink functions are in one shared object file.

e.g.
CREATE OR REPLACE FUNCTION dblink (text,text) RETURNS setof int
   AS 'MODULE_PATHNAME','dblink' LANGUAGE 'c'
   WITH (isstrict);

CREATE OR REPLACE FUNCTION dblink_tok (int,int) RETURNS text
   AS 'MODULE_PATHNAME','dblink_tok' LANGUAGE 'c'
   WITH (isstrict);
...
etc.

Joe


Wed, 14 Aug 2002 22:26:23 -0700
Joe Conway <mail@joeconway.com>
Re: contrib Makefiles
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> I guess my question would be that currently fulltextindex generates SQL like
> this:

> create function fti() returns opaque as
>         '$libdir/fti'
>         language 'C';

> So it references the fti.so, but where does it say what function to actually
> run in fti.so?  Or is it assumed in C functions that the function to call in
> the shared object is the same as the name of the function???

That's the assumption unless you specify differently.  Time to reread
the CREATE FUNCTION man page ...

			regards, tom lane

Thu, 15 Aug 2002 01:30:22 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: contrib Makefiles 

Yes, you can optionally specify the symbol to find in the *.so file as
part of the CREATE FUNCTION command.

---------------------------------------------------------------------------

Tom Lane wrote:
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > I guess my question would be that currently fulltextindex generates SQL like
> > this:
> 
> > create function fti() returns opaque as
> >         '$libdir/fti'
> >         language 'C';
> 
> > So it references the fti.so, but where does it say what function to actually
> > run in fti.so?  Or is it assumed in C functions that the function to call in
> > the shared object is the same as the name of the function???
> 
> That's the assumption unless you specify differently.  Time to reread
> the CREATE FUNCTION man page ...
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

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

Thu, 15 Aug 2002 10:02:51 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: contrib Makefiles