Thread: Re: Autoconf code

Re: Autoconf code

From
"Dave Page"
Date:
 
-----Original Message-----
From: Adam H. Pendleton [mailto:fmonkey@fmonkey.net]
Sent: 13 May 2003 19:56
To: Dave Page
Cc: Andreas Pflug; pgadmin-hackers@postgresql.org
Subject: Re: [pgadmin-hackers] Autoconf code

Dave Page wrote:
Thanks again Adam.
My pleasure.
as well as the install target that Andreas mentioned.
Actually, the install target is done.  It installs to --prefix or AC_DEFAULT_PREFIX, which I believe Andreas set to /usr/local/pgadmin3, but that is not in any code that I delivered, so it would have to be changed in the CVS tree. 
 
 
Ahh yes, I see some of it did make it into Makefile.in.
 
Strangely though I seem to be getting a build error now on the same box that worked earlier:

g++ -o pgAdmin3 pgAdmin3.o db/pgConn.o db/pgSet.o schema/pgAggregate.o schema/pgCast.o schema/pgCheck.o schema/pgCollection.o schema/pgColumn.o schema/pgConstraints.o schema/pgConversion.o schema/pgDatabase.o schema/pgDomain.o schema/pgForeignKey.o schema/pgFunction.o schema/pgGroup.o schema/pgIndex.o schema/pgIndexConstraint.o schema/pgLanguage.o schema/pgObject.o schema/pgOperator.o schema/pgOperatorClass.o schema/pgRule.o schema/pgSchema.o schema/pgSequence.o schema/pgServer.o schema/pgTable.o schema/pgTrigger.o schema/pgType.o schema/pgUser.o schema/pgView.o ui/ctlSQLBox.o ui/ctlSQLResult.o ui/dlgAddTableView.o ui/events.o ui/frmAbout.o ui/frmChildTableViewFrame.o ui/frmConnect.o ui/frmMain.o ui/frmOptions.o ui/frmPassword.o ui/frmQuery.o ui/frmQueryBuilder.o ui/frmQBJoin.o ui/frmSplash.o ui/frmVacuum.o ui/frmEditGrid.o ui/dlgProperty.o ui/dlgUser.o ui/dlgTable.o ui/dlgDatabase.o ui/dlgColumn.o ui/dlgIndex.o ui/dlgIndexConstraint.o ui/dlgForeignKey.o ui/dlgCheck.o ui/frmStatus.o utils/misc.o utils/sysLogger.o utils/sysSettings.o --static --static-libgcc -L/usr/local/lib -lwxxrc -lstc -L/usr/local/lib -pthread    /usr/local/lib/libwx_gtk-2.4.a -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lgthread -lglib -lpthread -ldl -lXext -lX11 -lm -lpng -ljpeg -ltiff -lz -ldl -lm  -L/usr/local/pgsql/lib -lpq
/usr/local/pgsql/lib/libpq.a(fe-auth.o)(.text+0x184): In function `pg_password_sendauth':
: undefined reference to `crypt'
collect2: ld returned 1 exit status
make: *** [pgAdmin3] Error 1
 
It looks like this is because some part are now being linked dynamically - adding /usr/lib/libcrypt.a to the LDFLAGS in the Makefile allowed it to compile but is obviously not the real answer.
 
Any thoughts? 
If your C++ is good, then before release we need to merge Keith's Query
Builder (from the context menu) and Andreas' Query Tool (from the SQL
button). There are 2 things to do here:
I'm not entirely sure what any of the above means, but I will take a look at it and see if I can't figure it out.  :)
 
It'll make more sense if you look at it, but the  end result is that we want one query tool option (the SQL button) to allow the use of either query tool which should both use the same query and display code.
 
Regards, Dave.

Re: Autoconf code

From
"Adam H. Pendleton"
Date:
It turns out the the real problem here is the "-static" flag to g++
(well, actually to ld).  On my redhat system, at least, this causes a
list of undefined symbols that I can't even begin to track down.
Removing the flag causes the program to compile fine.  I would just say
to any developer that if their system allows them to build with the
"-static" flag, then you can use it by changing:

LDFLAGS = @LDFLAGS@ -lpq

in Makefile.in to:

LDFLAGS = -static @LDFLAGS@ -lpq

Try it on your system and see what happens.  Incidentally, the "correct"
way to compile in a new library is to use -l<lib>, not to list the full
library.  So you should use -lcrypt instead of /usr/lib/libcrypt.a.  Not
that it matters.  At least it *shouldn't*.  :)

ahp

P.S. -- Attached is the latest code.

Attachment

Re: Autoconf code

From
Andreas Pflug
Date:
Dave Page wrote:

>
> : undefined reference to `crypt'
> collect2: ld returned 1 exit status
> make: *** [pgAdmin3] Error 1
>
> It looks like this is because some part are now being linked
> dynamically - adding /usr/lib/libcrypt.a to the LDFLAGS in the
> Makefile allowed it to compile but is obviously not the real answer.

I added -lcrypt to the Makefile.in before I added the file to cvs,
should link ok if the cvs version is used.
Replacing the 1.1 version with Adam's wasn't a good idea, because it
unfixed some fixes....
I'll fix it.

Regards,
Andreas