gcc ignoring defined macros?

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Cc: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>, "Adam H(dot)Pendleton" <fmonkey(at)fmonkey(dot)net>, "Network Administrator" <netadmin(at)vcsn(dot)com>
Subject: gcc ignoring defined macros?
Date: 2003-10-02 08:47:30
Message-ID: 03AF4E498C591348A42FC93DEA9661B83AF279@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi all,

This one is really wierd, and as neither Mark or I can figure it out,
maybe one of you knows what's going on!!

Some time ago, I noticed that non-debug builds of pgAdmin on Slackware,
did not pause to display the splash screen as they should. I spent about
2 minutes on the problem, and then moved on as I was busy with work
stuff, and promptly forgot about it.

Yesterday, Keith C. Perry posted a message to the support list stating
that under Slackware, the SSL combo box on frmConnect is empty, so he
was unable to select an SSL mode. First thing I checked was that I
really had built libpq on Snake with SSL support, which I had. I then
checked that pgAdmin was building with the SSL macro defined, which it
was. Finally I added a printf statement inside the #ifdef SSL block that
populates the combobox. That failed to print anything, indicating that
the preprocessor was not including that code.

So, I made a test program:

main() {
#ifdef SSL
printf("SSL defined.");
#else
printf("SSL not defined.");
#endif
}

This worked as expected when compiled with or without -DSSL on the g++
commmand line.

So I added some code to the top of pgAdmin3.cpp:

#ifdef SSL
printf("\nSSL is defined!\n\n");
#else
printf("\nSSL is not defined!\n\n");
#endif

and recompiled (see below). When running pgAdmin, it prints 'SSL is not
defined'. We're stumped here - any one else have any idea what's going
on?

Cheers, Dave

root(at)snake:/usr/local/src/pgadmin3-1.0.1# make all
make all-recursive
make[1]: Entering directory `/usr/local/src/pgadmin3-1.0.1'
Making all in src
make[2]: Entering directory `/usr/local/src/pgadmin3-1.0.1/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDATA_DIR=\"/usr/share/pgadmin3/\"
-Wall -g -I../src/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/share/pgadmin3/\" -Wall -g -I../src/include -I -g -O2
-MT pgAdmin3.o -MD -MP -MF ".deps/pgAdmin3.Tpo" \
-c -o pgAdmin3.o `test -f 'pgAdmin3.cpp' || echo './'`pgAdmin3.cpp; \
then mv ".deps/pgAdmin3.Tpo" ".deps/pgAdmin3.Po"; \
else rm -f ".deps/pgAdmin3.Tpo"; exit 1; \
fi
g++ -DDATA_DIR=\"/usr/share/pgadmin3/\" -Wall -g -I../src/include -I -g
-O2 -L/usr/local/pgsql/lib -L/usr/local//lib -o pgadmin3 pgAdmin3.o
pgConn.o pgSet.o keywords.o pgAggregate.o pgCast.o pgCheck.o
pgCollection.o pgColumn.o pgConstraints.o pgConversion.o pgDatabase.o
pgDomain.o pgForeignKey.o pgFunction.o pgGroup.o pgIndex.o
pgIndexConstraint.o pgLanguage.o pgObject.o pgOperator.o
pgOperatorClass.o pgRule.o pgSchema.o pgSequence.o pgServer.o pgTable.o
pgTrigger.o pgType.o pgUser.o pgView.o pgDatatype.o ctlSQLBox.o
ctlSQLResult.o frmExport.o dlgAddTableView.o events.o frmAbout.o
frmChildTableViewFrame.o frmConnect.o frmMain.o frmOptions.o
frmPassword.o frmQuery.o frmQueryBuilder.o frmHelp.o frmQBJoin.o
frmSplash.o frmMaintenance.o frmEditGrid.o dlgProperty.o dlgUser.o
dlgGroup.o dlgDatabase.o dlgLanguage.o dlgSchema.o dlgDomain.o
dlgTable.o dlgColumn.o dlgIndex.o dlgFunction.o dlgView.o dlgRule.o
dlgOperator.o dlgAggregate.o dlgCast.o dlgConversion.o
dlgIndexConstraint.o dlgForeignKey.o dlgSequence.o dlgTrigger.o
dlgType.o dlgCheck.o frmStatus.o misc.o sysLogger.o sysSettings.o
xrcDialogs.o /usr/local/pgsql/lib/libpq.a -lcrypt -lssl -lcrypto
/usr/local//lib/libwx_gtk2ud_stc-2.5.a
/usr/local//lib/libwx_gtk2ud_xrc-2.5.a -L/usr/local/lib -pthread
/usr/local/lib/libwx_gtk2ud-2.5.a -Wl,--export-dynamic -pthread
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl
-lgthread-2.0 -lglib-2.0 -Wl,--export-dynamic -lpangoft2-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lpng -ljpeg -ltiff -lz -ldl
-lm
make[2]: Leaving directory `/usr/local/src/pgadmin3-1.0.1/src'
make[2]: Entering directory `/usr/local/src/pgadmin3-1.0.1'
make[2]: Nothing to be done for `all-am'.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2003-10-02 10:02:34 wxWindows Upgrade
Previous Message Adam Witney 2003-10-02 08:13:50 Re: pgAdmin III under wxCocoa