Re: gcc ignoring defined macros? - Mailing list pgadmin-hackers

From Adam H. Pendleton
Subject Re: gcc ignoring defined macros?
Date
Msg-id 3F81A5A3.9020600@fmonkey.net
Whole thread Raw
In response to Re: gcc ignoring defined macros?  ("Dave Page" <dpage@vale-housing.co.uk>)
List pgadmin-hackers
Dave Page wrote:
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.
 
I was about to fix this, when I realized that I was about to add -DSSL to the command-line for *all* situations.  Is this what we want, or is this supposed to be a conditional compile option?  If it's needed for *all* situations, then why included it at all, why not just remove the #ifdefs and always compile the SSL code?

ahp

pgadmin-hackers by date:

Previous
From: "Adam H. Pendleton"
Date:
Subject: Update
Next
From: "Adam H. Pendleton"
Date:
Subject: CVS compile error