I've written PL/R to make use of the contrib build system, and modelled 
its Makefile after other contrib modules. One user who tried installing 
PL/R under OS X sent me this:

   The makefile does

   gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
   -Wmissing-declarations -fno-common   -install_name
   /usr/local/pgsql/lib/libplr.0.dylib  -dynamiclib  plr.o
   pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupport.o
   -L../../src/interfaces/libpq -L/usr/local/lib/R/bin -lR   -o
   libplr.0.0.dylib

   In OS X this should be

   gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
   -Wmissing-declarations -fno-common  -bundle -flat_namespace -undefined
   suppress  plr.o pg_conversion.o pg_backend_support.o pg_userfuncs.o
   pg_rsupport.o  -L../../src/interfaces/libpq -L/usr/local/lib/R/bin -lR
   -o plr.so

Below is the Makefile. The key problem is that I need to get a "bundle" 
built instead of a "dynamiclib", or so I am told.

Any idea what I'm doing wrong?

Thanks,

Joe


8<-------------------------------------
r_libdir = ${R_HOME}/bin
r_includespec = ${R_HOME}/include

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

override CPPFLAGS := -I$(srcdir) -I$(r_includespec) $(CPPFLAGS)
override CPPFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\" -DDLSUFFIX=\"$(DLSUFFIX)\"
rpath :=

MODULE_big      := plr
PG_CPPFLAGS     := -I$(r_includespec)
SRCS            += plr.c pg_conversion.c pg_backend_support.c 
pg_userfuncs.c pg_rsupport.c
OBJS            := $(SRCS:.c=.o)
SHLIB_LINK      := -L$(r_libdir) -lR

DATA_built      := plr.sql
DOCS            := README.plr
REGRESS         := plr
EXTRA_CLEAN     := doc/HTML.index

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




Thu, 20 Feb 2003 10:12:26 -0800
Joe Conway <mail@joeconway.com>
contrib Makefile's and OS X
Joe Conway <mail@joeconway.com> writes:
> Below is the Makefile. The key problem is that I need to get a "bundle" 
> built instead of a "dynamiclib", or so I am told.

It's quite likely that the problem is in Makefile.shlib and isn't
specific to plr at all.  Ask the complainant if plperl, pltcl, or
plpython work.

If it is specific to plr, the only idea I have is that maybe you need
to say SHLIB_LINK += not SHLIB_LINK :=

			regards, tom lane

Thu, 20 Feb 2003 23:16:52 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: contrib Makefile's and OS X 
Joe Conway writes:

> Below is the Makefile. The key problem is that I need to get a "bundle"
> built instead of a "dynamiclib", or so I am told.

The PostgreSQL makefiles do use "bundle".  Tell the user to use the
standard distribution.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 21 Feb 2003 11:03:20 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: contrib Makefile's and OS X


PL/R compiles and installs ok on my OS X 10.2.4, the corresponding line is

gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
-Wmissing-declarations  -flat_namespace -bundle -undefined suppress plr.o
pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupport.o -L/sw/lib
-L/sw/lib/R/bin -lR   -o libplr.so.0.0
 

adam


> I've written PL/R to make use of the contrib build system, and modelled
> its Makefile after other contrib modules. One user who tried installing
> PL/R under OS X sent me this:
> 
>  The makefile does
> 
>  gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
>  -Wmissing-declarations -fno-common   -install_name
>  /usr/local/pgsql/lib/libplr.0.dylib  -dynamiclib  plr.o
>  pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupport.o
>  -L../../src/interfaces/libpq -L/usr/local/lib/R/bin -lR   -o
>  libplr.0.0.dylib
> 
>  In OS X this should be
> 
>  gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
>  -Wmissing-declarations -fno-common  -bundle -flat_namespace -undefined
>  suppress  plr.o pg_conversion.o pg_backend_support.o pg_userfuncs.o
>  pg_rsupport.o  -L../../src/interfaces/libpq -L/usr/local/lib/R/bin -lR
>  -o plr.so
> 
> Below is the Makefile. The key problem is that I need to get a "bundle"
> built instead of a "dynamiclib", or so I am told.
> 
> Any idea what I'm doing wrong?
> 
> Thanks,
> 
> Joe
> 
> 
> 8<-------------------------------------
> r_libdir = ${R_HOME}/bin
> r_includespec = ${R_HOME}/include
> 
> subdir = contrib/plr
> top_builddir = ../..
> include $(top_builddir)/src/Makefile.global
> 
> override CPPFLAGS := -I$(srcdir) -I$(r_includespec) $(CPPFLAGS)
> override CPPFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\" -DDLSUFFIX=\"$(DLSUFFIX)\"
> rpath :=
> 
> MODULE_big      := plr
> PG_CPPFLAGS     := -I$(r_includespec)
> SRCS            += plr.c pg_conversion.c pg_backend_support.c
> pg_userfuncs.c pg_rsupport.c
> OBJS            := $(SRCS:.c=.o)
> SHLIB_LINK      := -L$(r_libdir) -lR
> 
> DATA_built      := plr.sql
> DOCS            := README.plr
> REGRESS         := plr
> EXTRA_CLEAN     := doc/HTML.index
> 
> include $(top_srcdir)/contrib/contrib-global.mk
> 8<-------------------------------------
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Fri, 21 Feb 2003 13:50:59 +0000
Adam Witney <awitney@sghms.ac.uk>
Re: contrib Makefile's and OS X
Adam Witney wrote:
> 
> PL/R compiles and installs ok on my OS X 10.2.4, the corresponding line is
> 
> gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
> -Wmissing-declarations  -flat_namespace -bundle -undefined suppress plr.o
> pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupport.o -L/sw/lib
> -L/sw/lib/R/bin -lR   -o libplr.so.0.0
>  

Thanks Adam, Peter, and Tom for your replies. I'll make the minor change 
Tom recommended, try to find out what distribution the person is using, 
and recommend they switch to the standard one.

Joe



Fri, 21 Feb 2003 06:56:15 -0800
Joe Conway <mail@joeconway.com>
Re: contrib Makefile's and OS X
Joe Conway wrote:
> Adam Witney wrote:
> > 
> > PL/R compiles and installs ok on my OS X 10.2.4, the corresponding line is
> > 
> > gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes
> > -Wmissing-declarations  -flat_namespace -bundle -undefined suppress plr.o
> > pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupport.o -L/sw/lib
> > -L/sw/lib/R/bin -lR   -o libplr.so.0.0
> >  
> 
> Thanks Adam, Peter, and Tom for your replies. I'll make the minor change 
> Tom recommended, try to find out what distribution the person is using, 
> and recommend they switch to the standard one.

This gets into the problem if distributing PL/R outside our tarball. 
Are you still able to use our Makefile.shlib in your build?

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

Wed, 5 Mar 2003 23:54:55 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: contrib Makefile's and OS X
Bruce Momjian wrote:
> Joe Conway wrote:
>>Thanks Adam, Peter, and Tom for your replies. I'll make the minor change 
>>Tom recommended, try to find out what distribution the person is using, 
>>and recommend they switch to the standard one.
> 
> This gets into the problem if distributing PL/R outside our tarball. 
> Are you still able to use our Makefile.shlib in your build?
> 

Actually, I guess I never did close the loop on this; the person 
reporting the problem did switch to a standard distribution, and that 
solved the problem.

As far as Makefile.shlib goes, yes, PL/R requires the full 'configure'd 
PostgreSQL source tree, with plr in a folder under contrib. Seems to 
work well.

Joe


Wed, 05 Mar 2003 21:03:48 -0800
Joe Conway <mail@joeconway.com>
Re: contrib Makefile's and OS X