Re: Postgres 7.3 from source --with-tcl : Errors again...

Lists: pgsql-cygwin
From: Andrew Klimov <and_k_98(at)yahoo(dot)com>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: Postgres 7.3 from source --with-tcl : Errors again... (part 2)
Date: 2003-01-14 17:31:25
Message-ID: 20030114173125.64002.qmail@web20422.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin


Thank you, Jason, for fast reply to my previous e-mail.These errors were occured while linking:

dllwrap -o pgtcl.dll --dllname pgtcl.dll --def pgtcl.def pgtcl.o pgtclCmds.o pgtclId.o ../../../src/utils/dllinit.o -L/usr/local/lib -L../../../src/interfaces/libpq -lpq -L/usr/local/lib -lcrypt

pgtcl.o(.text+0x13d):pgtcl.c: undefined reference to `_Tcl_GetVar'
pgtcl.o(.text+0x147):pgtcl.c: undefined reference to `_Tcl_GetDouble'
pgtcl.o(.text+0x186):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1a0):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1ba):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1d4):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1ee):pgtcl.c: undefined reference to `_Tcl_CreateCommand'

....

However, I've seems to be fixed it by myself by modifying SHLIB_LINK variable in /src/interfaces/libpgtcl. Original SHLIB_LINK :

SHLIB_LINK = $(libpq)

My SHLIB_LINK:

SHLIB_LINK = -lcygtcl83 -lcygtk83 $(libpq) (I'm not sure about -lcygtk83 necessity.)

With this make proceeds building pgtcl.dll and pq.dll successfully.However, when go to /src/pl/tcl directory and trying to build pltcl:

make[3]: Entering directory `/usr/src/postgresql-7.3.1/src/pl/tcl'
gcc-2 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o pltcl.o pltcl.c

In file included from pltcl.c:40:
/usr/include/tcl.h:234: warning: `DLLIMPORT' redefined
../../../src/include/pg_config_os.h:26: warning: this is the location of the previous definition

dlltool --export-all --output-def pltcl.def pltcl.o
dllwrap -o pltcl.dll --dllname pltcl.dll --def pltcl.def pltcl.o ../../../src/utils/dllinit.o -L/usr/local/lib -L/usr/lib -lcygtcl83

tcl.o(.text+0x4):pltcl.c: undefined reference to `_TopMemoryContext'
tcl.o(.text+0x18):pltcl.c: undefined reference to `_fmgr_info_cxt'
tcl.o(.text+0x108):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x13b):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x17c):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x3a3):pltcl.c: undefined reference to `_SPI_connect'
tcl.o(.text+0x3b7):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x3c8):pltcl.c: undefined reference to `_SPI_finish'
tcl.o(.text+0x3df):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x56f):pltcl.c: undefined reference to `_SPI_exec'
tcl.o(.text+0x579):pltcl.c: undefined reference to `_SPI_tuptable'
tcl.o(.text+0x57f):pltcl.c: undefined reference to `_SPI_freetuptable'
tcl.o(.text+0x596):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x59f):pltcl.c: undefined reference to `_SPI_processed'
tcl.o(.text+0x5c4):pltcl.c: undefined reference to `_SPI_exec'
tcl.o(.text+0x5dd):pltcl.c: undefined reference to `_elog'
tcl.o(.text+0x5e6):pltcl.c: undefined reference to `_SPI_processed'
tcl.o(.text+0x600):pltcl.c: undefined reference to `_SPI_tuptable'
tcl.o(.text+0x606):pltcl.c: undefined reference to `_SPI_freetuptable'

... (The same thing was in Postgresql 7.2.3)

Does these errors points to another missing -l<library> option in makefile from /usr/src/pl/tcl? And what is the name of this library?

Any help would be very appreciated.

Andrew.

---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


From: Jason Tishler <jason(at)tishler(dot)net>
To: Andrew Klimov <and_k_98(at)yahoo(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Postgres 7.3 from source --with-tcl : Errors again...
Date: 2003-01-14 20:13:52
Message-ID: 20030114201352.GD1692@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Andrew,

[Peter, please comment on my last question and the patch in general. Is
such a patch desired now that Cygwin supports a more recent Tcl/Tk
version? Would you be willing to help me polish it since I'm not sure
how to resolve some of the issues properly?]

On Tue, Jan 14, 2003 at 09:31:25AM -0800, Andrew Klimov wrote:
> Thank you, Jason, for fast reply to my previous e-mail.

No problem.

Attached is a *work-in-progress* patch that enables PostgreSQL CVS to
build "cleanly" when configured as follows:

$ configure --with-tcl --with-tclconfig=/usr/lib ...

Note that I needed to configure --with-tclconfig, but I did *not* have to
do the following:

$ ln -s /bin/tclsh83 /bin/tclsh
$ ln -s /bin/wish83.exe /bin/wish

to get configure to succeed. However, see my final point below...

> With this make proceeds building pgtcl.dll and pq.dll
> successfully.However, when go to /src/pl/tcl directory and trying to
> build pltcl:
>
> make[3]: Entering directory `/usr/src/postgresql-7.3.1/src/pl/tcl'
> gcc-2 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/
^^^^^
*****

> include -c -o pltcl.o pltcl.c
>
> In file included from pltcl.c:40:
> /usr/include/tcl.h:234: warning: `DLLIMPORT' redefined
> ../../../src/include/pg_config_os.h:26: warning: this is the location of the
> previous definition

gcc 3.2 did not produce the above warning! I wish that it did, because
it would have saved me some time. The above is "worked around" in my
patch by including pg_config_os.h before tcl.h. Unfortunately, there is
a namespace clash with DLLIMPORT in the PostgreSQL and TCL sources. I'm
not sure what is the best way to fix this long term.

BTW, I'm wondering if PostgreSQL's autoconf stuff (i.e., config/tcl.m4)
should be modified to find Cygwin's tclsh (i.e., tclsh83.exe)? I
believe that this should obviate the need to configure --with-tclconfig.

Thanks,
Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6

Attachment Content-Type Size
tcl.patch text/plain 2.1 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jason Tishler <jason(at)tishler(dot)net>
Cc: Andrew Klimov <and_k_98(at)yahoo(dot)com>, <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Postgres 7.3 from source --with-tcl : Errors again...
Date: 2003-01-17 17:35:35
Message-ID: Pine.LNX.4.44.0301162321540.789-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Jason Tishler writes:

> Attached is a *work-in-progress* patch that enables PostgreSQL CVS to
> build "cleanly" when configured as follows:
>
> $ configure --with-tcl --with-tclconfig=/usr/lib ...

I had played around with fixing the Tcl stuff on Cygwin, too, but I don't
recall that the solution was that easy. Have you tried actually running
the PL/Tcl language (there's a test suite in the source tree)?

> BTW, I'm wondering if PostgreSQL's autoconf stuff (i.e., config/tcl.m4)
> should be modified to find Cygwin's tclsh (i.e., tclsh83.exe)?

I don't think so. If we had to follow everyone's idea for naming the Tcl
shell (for every version) we could never keep up. Plus ...

> I believe that this should obviate the need to configure
> --with-tclconfig.

I don't believe that either. The tclsh83.exe on Cygwin prints out
DOS-style paths, which would surely confuse things.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Jason Tishler <jason(at)tishler(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Klimov <and_k_98(at)yahoo(dot)com>, pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Postgres 7.3 from source --with-tcl : Errors again...
Date: 2003-01-20 15:40:53
Message-ID: 20030120154053.GD1444@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Peter,

[Andrew, please answer the question addressed to you below.]

On Fri, Jan 17, 2003 at 06:35:35PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
> > Attached is a *work-in-progress* patch that enables PostgreSQL CVS to
> > build "cleanly" when configured as follows:
> >
> > $ configure --with-tcl --with-tclconfig=/usr/lib ...
>
> I had played around with fixing the Tcl stuff on Cygwin, too, but I
> don't recall that the solution was that easy.

Were you playing with Cygwin Tcl/Tk 8.0 or 8.3? Maybe things improved
(i.e., got easier) with 8.3?

> Have you tried actually running the PL/Tcl language (there's a test
> suite in the source tree)?

I just tried now and unfortunately, I'm got errors with all inserts.
See attached for the output of runtest, runtest2.out, and test.out.

Andrew, did you get PL/Tcl to work?

> > BTW, I'm wondering if PostgreSQL's autoconf stuff (i.e.,
> > config/tcl.m4) should be modified to find Cygwin's tclsh (i.e.,
> > tclsh83.exe)?
>
> I don't think so. If we had to follow everyone's idea for naming the
> Tcl shell (for every version) we could never keep up. Plus ...

OK. It was just a thought.

> > I believe that this should obviate the need to configure
> > --with-tclconfig.
>
> I don't believe that either. The tclsh83.exe on Cygwin prints out
> DOS-style paths, which would surely confuse things.

OK, that is why I said "believe." I wish that Cygwin Tcl/Tk was a true
Cygwin port and not the Win32/Cygwin hybrid that it is.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6

Attachment Content-Type Size
runtest2.out text/plain 386 bytes
test.out text/plain 4.6 KB