interface libpq Makefile.in patch

Started by Ryan Bradetichabout 27 years ago5 messageshackers
Jump to latest
#1Ryan Bradetich
rbrad@hpb50023.boi.hp.com

Hello Hackers ...

The following patch is needed to compile the current development tree with perl
support. The addition of MemoryContextAlloc, MemoryContextFree, and
MemoryContexRealloc in ./src/include/utils/palloc.h require these additional
header files.

Also where is the current TODO list, I'd like to pick a small project and help
out when I can.

Thanks,
-Ryan

P.S.

If I created this patch wrong, or I posted it to the wrong place let me know and
I'll correct it next time.

*** ./src/interfaces/libpq/Makefile.in.orig  Wed Feb 10 19:11:55 1999
--- ./src/interfaces/libpq/Makefile.in       Wed Feb 10 19:09:25 1999
***************
*** 106,121 ****
            $(HEADERDIR)/utils/elog.h
        $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/palloc.h \
            $(HEADERDIR)/utils/palloc.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/mcxt.h \
-           $(HEADERDIR)/utils/mcxt.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/nodes/memnodes.h \
-           $(HEADERDIR)/nodes/memnodes.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/nodes/nodes.h \
-           $(HEADERDIR)/nodes/nodes.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/lib/fstack.h \
-           $(HEADERDIR)/lib/fstack.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/memutils.h \
-           $(HEADERDIR)/utils/memutils.h
        $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/access/attnum.h \
            $(HEADERDIR)/access/attnum.h
        $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/executor/spi.h \
--- 106,111 ----
***************
*** 139,146 ****
        @if [ ! -d $(HEADERDIR)/libpq ]; \
                then mkdir $(HEADERDIR)/libpq; fi
        @if [ ! -d $(HEADERDIR)/utils ]; \
-               then mkdir $(HEADERDIR)/nodes; fi
-       @if [ ! -d $(HEADERDIR)/nodes ]; \
                then mkdir $(HEADERDIR)/utils; fi
        @if [ ! -d $(HEADERDIR)/access ]; \
                then mkdir $(HEADERDIR)/access; fi
--- 129,134 ----
#2Bruce Momjian
bruce@momjian.us
In reply to: Ryan Bradetich (#1)
Re: [HACKERS] interface libpq Makefile.in patch

See the /doc directory or the web site under Support.

Hello Hackers ...

The following patch is needed to compile the current development tree with perl
support. The addition of MemoryContextAlloc, MemoryContextFree, and
MemoryContexRealloc in ./src/include/utils/palloc.h require these additional
header files.

Also where is the current TODO list, I'd like to pick a small project and help
out when I can.

Thanks,
-Ryan

P.S.

If I created this patch wrong, or I posted it to the wrong place let me know and
I'll correct it next time.

*** ./src/interfaces/libpq/Makefile.in.orig  Wed Feb 10 19:11:55 1999
--- ./src/interfaces/libpq/Makefile.in       Wed Feb 10 19:09:25 1999
***************
*** 106,121 ****
$(HEADERDIR)/utils/elog.h
$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/palloc.h \
$(HEADERDIR)/utils/palloc.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/mcxt.h \
-           $(HEADERDIR)/utils/mcxt.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/nodes/memnodes.h \
-           $(HEADERDIR)/nodes/memnodes.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/nodes/nodes.h \
-           $(HEADERDIR)/nodes/nodes.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/lib/fstack.h \
-           $(HEADERDIR)/lib/fstack.h
-       $(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/memutils.h \
-           $(HEADERDIR)/utils/memutils.h
$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/access/attnum.h \
$(HEADERDIR)/access/attnum.h
$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/executor/spi.h \
--- 106,111 ----
***************
*** 139,146 ****
@if [ ! -d $(HEADERDIR)/libpq ]; \
then mkdir $(HEADERDIR)/libpq; fi
@if [ ! -d $(HEADERDIR)/utils ]; \
-               then mkdir $(HEADERDIR)/nodes; fi
-       @if [ ! -d $(HEADERDIR)/nodes ]; \
then mkdir $(HEADERDIR)/utils; fi
@if [ ! -d $(HEADERDIR)/access ]; \
then mkdir $(HEADERDIR)/access; fi
--- 129,134 ----
-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ryan Bradetich (#1)
Re: [HACKERS] interface libpq Makefile.in patch

Ryan Bradetich <rbrad@hpb50023.boi.hp.com> writes:

The following patch is needed to compile the current development tree
with perl support. The addition of MemoryContextAlloc,
MemoryContextFree, and MemoryContexRealloc in
./src/include/utils/palloc.h require these additional header files.

Something wrong here ... palloc should not be visible outside the
backend. libpq used to have vestigial dependencies on some backend
header files, but I thought I'd got rid of them.

I have not compiled the perl module in a while; I'll check this.

regards, tom lane

#4Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#3)
Re: [HACKERS] interface libpq Makefile.in patch

On Thu, Feb 11, 1999 at 12:18:06AM -0500, Tom Lane wrote:

Ryan Bradetich <rbrad@hpb50023.boi.hp.com> writes:

The following patch is needed to compile the current development tree
with perl support. The addition of MemoryContextAlloc,
MemoryContextFree, and MemoryContexRealloc in
./src/include/utils/palloc.h require these additional header files.

Something wrong here ... palloc should not be visible outside the
backend. libpq used to have vestigial dependencies on some backend
header files, but I thought I'd got rid of them.

I have not compiled the perl module in a while; I'll check this.

They are back in. And even worse palloc.h include mcxt.h and this one isn't
even installed.

Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net | Use PostgreSQL!

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Meskes (#4)
Re: [HACKERS] interface libpq Makefile.in patch

The following patch is needed to compile the current development tree
with perl support. The addition of MemoryContextAlloc,
MemoryContextFree, and MemoryContexRealloc in
./src/include/utils/palloc.h require these additional header files.

Something wrong here ... palloc should not be visible outside the
backend.

I have fixed the immediate symptom of the problem by making the Perl5
module not require libpq-int.h, which is better programming practice
anyway.

However, it is true that including libpq-int.h now requires access
to backend include files that are not currently being installed into
/usr/local/pgsql/include. Thus, compiling an outside application
that uses libpq-int.h will presently fail.

I had intended all along to someday stop exporting libpq-int.h, but I
didn't really want to break code dependent on it this soon :-(.
In any case, I think that the very same problem will occur for backend
extension code (SPI) compiled outside the Postgres source tree --- the
real problem is that "postgres.h" can't be included from the install
tree anymore.

I think we have two reasonable alternatives:

(1) Install a bunch more backend-internals header files, along the lines
of Ryan's proposed patch. Evidently we need
include/utils/mcxt.h
include/nodes/memnodes.h
include/nodes/nodes.h
include/lib/fstack.h
include/utils/memutils.h
and possibly other stuff.

(2) Try to clean up the palloc macros so that they don't need quite as
many random include files to be available. (Jan? Any chance of
reducing the tonnage a little?)

BTW, it'd really be a good idea to stop using libpq's makefile as the
place where backend header files are installed...

regards, tom lane