Hi!

Is there any reason why FRONTEND is not specified in the ecpg build
(specifically the pgtypeslib)? I'm running into build problems because
it pulls backend-specific stuff from port.h in
(postgres_fe.h->c.h->port.h) when tweaking the timezone code.

Or should FRONTEND perhaps even be explicitly #defined in postgres_fe.h?

Or am I misunderstanding what FRONTEND is for?

//Magnus


Tue, 13 Apr 2004 20:22:56 +0200
"Magnus Hagander" <mha@sollentuna.net>
FRONTEND in ecpg
Magnus Hagander wrote:
> Hi!
> 
> Is there any reason why FRONTEND is not specified in the ecpg build
> (specifically the pgtypeslib)? I'm running into build problems because
> it pulls backend-specific stuff from port.h in
> (postgres_fe.h->c.h->port.h) when tweaking the timezone code.
> 
> Or should FRONTEND perhaps even be explicitly #defined in postgres_fe.h?

You know, that is an excellent idea. I have been adding FRONTEND to
specific Makefiles just in cases where I need special src/port compiles
of files, but putting it in postgres_fe.h would hit all of them nicely.

Let me make that change now.

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

Tue, 13 Apr 2004 14:50:11 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: FRONTEND in ecpg
Magnus Hagander wrote:
> Hi!
> 
> Is there any reason why FRONTEND is not specified in the ecpg build
> (specifically the pgtypeslib)? I'm running into build problems because
> it pulls backend-specific stuff from port.h in
> (postgres_fe.h->c.h->port.h) when tweaking the timezone code.
> 
> Or should FRONTEND perhaps even be explicitly #defined in postgres_fe.h?
> 
> Or am I misunderstanding what FRONTEND is for?

Looking now, it is a chicken and egg thing.  Some port/src C files need
to know which file to include:
	
	#ifndef FRONTEND
	#include "postgres.h"
	#else
	#include "postgres_fe.h"
	#endif

so it looks like we have to a keep adding to Makefiles.  Sorry.

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

Tue, 13 Apr 2004 15:09:02 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: FRONTEND in ecpg
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Or should FRONTEND perhaps even be explicitly #defined in postgres_fe.h?

> You know, that is an excellent idea. I have been adding FRONTEND to
> specific Makefiles just in cases where I need special src/port compiles
> of files, but putting it in postgres_fe.h would hit all of them nicely.

There are some source files that #include c.h instead of either
postgres.h or postgres_fe.h; this would *not* hit those.

> Let me make that change now.

Better test before committing.

			regards, tom lane

Tue, 13 Apr 2004 15:45:28 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: FRONTEND in ecpg 