contrib Makefiles

Started by Christopher Kings-Lynneover 23 years ago8 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

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

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Christopher Kings-Lynne (#1)
Re: 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

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Peter Eisentraut (#2)
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

Show quoted text

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#3)
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

#5Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#4)
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

#6Joe Conway
mail@joeconway.com
In reply to: Christopher Kings-Lynne (#5)
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

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#5)
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

#8Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#7)
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