Re: gcc ignoring defined macros?

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Adam H(dot) Pendleton" <fmonkey(at)fmonkey(dot)net>
Cc: "Hiroshi Saito" <saito(at)inetrt(dot)skcapi(dot)co(dot)jp>, <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: gcc ignoring defined macros?
Date: 2003-10-03 07:47:29
Message-ID: 03AF4E498C591348A42FC93DEA9661B83AF27B@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Adam H. Pendleton [mailto:fmonkey(at)fmonkey(dot)net]
> Sent: 02 October 2003 23:29
> To: Dave Page
> Cc: Hiroshi Saito; pgadmin-hackers(at)postgresql(dot)org
> Subject: Re: [pgadmin-hackers] gcc ignoring defined macros?
>
>
>
> How are you adding the -DSSL flag to the command line? It might be
> mistaken for a linker flag because of its location in the
> args. Just a
> shot in the dark, really...

Ah-ha!!

Right, I editted the line in src/Makefile that compiles frmConnect.cpp.
I added -DSSL so the final command read:

if g++ -DSSL -DHAVE_CONFIG_H -I. ........

And that works. :-)

Further investigation of the command line:

if g++ -DHAVE_CONFIG_H -I. -I. -I..
-DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall -g
-I../src/include -I../src/agent/include -I -DSSL
-I/usr/local/pgsql/include -I/usr/local/lib/wx/include/gtk2ud-2.5
-D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-I/usr/local/include -DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\"
-Wall -g -I../src/include -I../src/agent/include -I -g -O2 -MT
frmConnect.o -MD -MP -MF ".deps/frmConnect.Tpo" \
-c -o frmConnect.o `test -f 'ui/frmConnect.cpp' || echo
'./'`ui/frmConnect.cpp; \
then mv ".deps/frmConnect.Tpo" ".deps/frmConnect.Po"; \
else rm -f ".deps/frmConnect.Tpo"; exit 1; \
fi

shows up the problem. Firstly, a bunch of it seems to be included twice.
Note the double inclusion of:

-DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall -g
-I../src/include -I../src/agent/include -I

Then secondly, notice the -I on the end which does not have a path -
that's what seems to be losing the SSL definition because it gets picked
up as the argument to -I. Further investigation shows that that path is
set to ${WXHOME} which is ovbviously empty when the command is created.
Adding a / to the end of it makes things work nicely.

Not sure about the best way to fix this properly, so I guess it's over
to you Adam :-)

Regards, Dave.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2003-10-03 07:48:41 Re: CVS compile error
Previous Message Jean-Michel POURE 2003-10-03 07:30:55 Re: wxWindows Upgrade