Thread: Proposed cleanup of generated header files

Proposed cleanup of generated header files

From
Tom Lane
Date:
It's bothered me for some time that backend files need to be compiled
with -I src/backend as well as -I src/include.  AFAICT this is just
because the two header files that are generated on-the-fly (parse.h
and fmgroids.h, formerly known as fmgr.h) are included from src/backend
rather than being inserted into the include tree, which it seems to me
is where they should be.  Any objections if I rearrange the makefiles
so that these files get placed under include/ when they are built,
and then -I src/backend goes away?

(In case anyone is wondering, there are no platform-dependencies in
either file.  We could distribute them as part of the distribution
tarball --- in fact we already do so for parse.h.  So I don't see
that installing them into src/include would create any problems for
multiplatform builds.)
        regards, tom lane


Re: Proposed cleanup of generated header files

From
Bruce Momjian
Date:
> It's bothered me for some time that backend files need to be compiled
> with -I src/backend as well as -I src/include.  AFAICT this is just
> because the two header files that are generated on-the-fly (parse.h
> and fmgroids.h, formerly known as fmgr.h) are included from src/backend
> rather than being inserted into the include tree, which it seems to me
> is where they should be.  Any objections if I rearrange the makefiles
> so that these files get placed under include/ when they are built,
> and then -I src/backend goes away?
> 
> (In case anyone is wondering, there are no platform-dependencies in
> either file.  We could distribute them as part of the distribution
> tarball --- in fact we already do so for parse.h.  So I don't see
> that installing them into src/include would create any problems for
> multiplatform builds.)

Agreed.

--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Proposed cleanup of generated header files

From
The Hermit Hacker
Date:
On Sun, 28 May 2000, Tom Lane wrote:

> It's bothered me for some time that backend files need to be compiled
> with -I src/backend as well as -I src/include.  AFAICT this is just
> because the two header files that are generated on-the-fly (parse.h
> and fmgroids.h, formerly known as fmgr.h) are included from src/backend
> rather than being inserted into the include tree, which it seems to me
> is where they should be.  Any objections if I rearrange the makefiles
> so that these files get placed under include/ when they are built,
> and then -I src/backend goes away?
> 
> (In case anyone is wondering, there are no platform-dependencies in
> either file.  We could distribute them as part of the distribution
> tarball --- in fact we already do so for parse.h.  So I don't see
> that installing them into src/include would create any problems for
> multiplatform builds.)

Sounds perfect to me ... just make changes to prep_release in tools so
that they are generated for the snapshots?




Re: Proposed cleanup of generated header files

From
Tom Lane
Date:
>> Any objections if I rearrange the makefiles
>> so that these files get placed under include/ when they are built,
>> and then -I src/backend goes away?

Done.  Note you'd be well advised to do make distclean / configure
after pulling these updates --- lotta Makefile.in files changed...

The Hermit Hacker <scrappy@hub.org> writes:
> Sounds perfect to me ... just make changes to prep_release in tools so
> that they are generated for the snapshots?

No point in changing prep_release that I can see.  fmgroids.h has to
have a dependency on Gen_fmgrtab.sh, which is built at configure time
from Gen_fmgrtab.sh.in.  So it'd get rebuilt anyway, even though there's
no real platform dependency in it.  parse.h is distributed in the
tarball in backend/parser where it's built, so we don't need another
copy distributed in include/parser.
        regards, tom lane