Thread: Compiling cvs code with Cygwin problems

Compiling cvs code with Cygwin problems

From
"Francisco Figueiredo Jr."
Date:

Hi all,

I tried to compile 7.4 from cvs and I got some problems:

The first is the <port/win32defs.h> not found. I couldn't find it anywhere!
Where can I find it??

So I commented it out from the header and it started to compile.

Later I got linking problems in the ecpg with a lot of unresolved references.
I could get ride of some of them by including some .o from pgtypeslib dir in
the OBJS of Makefile, but it still gives me this error:

================
make -C ecpglib all
make[1]: Entering directory
`/home/voidmain/PostgresqlCVS/pgsql/src/interfaces/e
cpgold/ecpglib'
dlltool --export-all --output-def ecpg.def execute.o typename.o descriptor.o
dat
a.o error.o prepare.o memory.o connect.o misc.o ../pgtypeslib/numeric.o
../pgtyp
eslib/datetime.o ../pgtypeslib/dt_common.o ../pgtypeslib/interval.o
../pgtypesli
b/timestamp.o ../pgtypeslib/common.o
dllwrap -o ecpg.dll --dllname ecpg.dll --def ecpg.def execute.o typename.o
descr
iptor.o data.o error.o prepare.o memory.o connect.o misc.o
../pgtypeslib/numeric
.o ../pgtypeslib/datetime.o ../pgtypeslib/dt_common.o ../pgtypeslib/interval.o
.
./pgtypeslib/timestamp.o ../pgtypeslib/common.o ../../../../src/utils/dllinit.o
-L../../../../src/port -L/usr/local/lib -L../../../../src/interfaces/libpq -lpq

descriptor.o(.text+0x102):descriptor.c: undefined reference to `__imp__sqlca'
descriptor.o(.text+0x7c6):descriptor.c: undefined reference to `__imp__sqlca'
data.o(.text+0x3ce):data.c: undefined reference to `__imp__sqlca'
data.o(.text+0x70c):data.c: undefined reference to `__imp__sqlca'
error.o(.text+0x596):error.c: undefined reference to `__imp__sqlca'
error.o(.text+0x606):error.c: more undefined references to `__imp__sqlca'
follow

connect.o(.text+0xaed):connect.c: undefined reference to `_ecpg_compat_mode'
misc.o(.text+0x1a):misc.c: undefined reference to `__imp__sqlca'
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1

===========================

Ok, I removed this folder thinking that as it is an interface for embedding sql
in C, I won't use it for now. And it continued to compile...

Until the following line:

make[2]: Leaving directory `/home/voidmain/PostgresqlCVS/pgsql/src/bin'
make -C pl all
make[2]: Entering directory `/home/voidmain/PostgresqlCVS/pgsql/src/pl'
make[3]: Entering directory `/home/voidmain/PostgresqlCVS/pgsql/src/pl/plpgsql'
make -C src all
make[4]: Entering directory
`/home/voidmain/PostgresqlCVS/pgsql/src/pl/plpgsql/s
rc'
bison -y -d  gram.y
NONE:0: /usr/bin/m4: ERROR: EOF in string
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.c > ./pl_gram.c
cannot open y.tab.c: no such file
make[4]: *** [pl.tab.h] Error 1
make[4]: Leaving directory
`/home/voidmain/PostgresqlCVS/pgsql/src/pl/plpgsql/sr
c'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/voidmain/PostgresqlCVS/pgsql/src/pl/plpgsql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/voidmain/PostgresqlCVS/pgsql/src/pl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/voidmain/PostgresqlCVS/pgsql/src'
make: *** [all] Error 2

I know this is cvs code and it is subjected to this type of problems.
I'd like to know if this is the case or it may be some problem of cygwin or my
setup here.

My setup:

Cygwin version(from setup.ini)
setup-timestamp: 1051174213
setup-version: 2.340.2.5

GCC:
gcc (GCC) 3.2 20020927 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Windows 2k sp3

Thanks in advance.




=====
Regards,
Francisco Figueiredo Jr.
---
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

_______________________________________________________________________
Yahoo! Mail
O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam.
http://br.mail.yahoo.com/


Re: Compiling cvs code with Cygwin problems

From
Jason Tishler
Date:
All,

PostgreSQL CVS no longer builds cleanly under Cygwin -- although, it
does so under Linux (no surprise). :,)  My plate is full right now.  So,
if anyone would like to help fix the Cygwin build, it would be much
appreciated...

Francisco,

On Sun, Apr 27, 2003 at 11:03:49AM -0300, Francisco Figueiredo Jr. wrote:
> I tried to compile 7.4 from cvs and I got some problems:

I just tried it myself.  See my comments in-line, below...

> The first is the <port/win32defs.h> not found. I couldn't find it
> anywhere!

Me neither.

> Where can I find it??

Sorry, but I don't know.

> So I commented it out from the header and it started to compile.

I used the following workaround instead:

    touch src/include/port/win32defs.h

> Later I got linking problems in the ecpg with a lot of unresolved
> references.

I can confirm the above.

> I could get ride of some of them by including some .o from pgtypeslib
> dir in the OBJS of Makefile,

I didn't try the above (yet).

> but it still gives me this error:
>
> ================
> make -C ecpglib all
> make[1]: Entering directory `/home/voidmain/PostgresqlCVS/pgsql/src/interfaces/ecpgold/ecpglib'
> dlltool --export-all --output-def ecpg.def execute.o typename.o ...
> [snip]
>
> descriptor.o(.text+0x102):descriptor.c: undefined reference to `__imp__sqlca'
> descriptor.o(.text+0x7c6):descriptor.c: undefined reference to `__imp__sqlca'
> data.o(.text+0x3ce):data.c: undefined reference to `__imp__sqlca'
> [snip]
> connect.o(.text+0xaed):connect.c: undefined reference to `_ecpg_compat_mode'
> misc.o(.text+0x1a):misc.c: undefined reference to `__imp__sqlca'
> collect2: ld returned 1 exit status
> dllwrap: gcc exited with status 1

It's just a WAG, but the above smells like missing DLLIMPORTs...

> [snip]
> Until the following line:
>
> [snip]
> make[4]: Entering directory `/home/voidmain/PostgresqlCVS/pgsql/src/pl/plpgsql/src'
> bison -y -d  gram.y
> NONE:0: /usr/bin/m4: ERROR: EOF in string
> sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.c > ./pl_gram.c
> cannot open y.tab.c: no such file
> make[4]: *** [pl.tab.h] Error 1

I do not get the above.  However, I get the following instead:

    dllwrap -o plpgsql.dll --dllname plpgsql.dll --def plpgsql.def ...
    fu000001.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
    [snip]
    fu000006.o(.idata$3+0xc): more undefined references to `_libpostgres_a_iname' follow
    nmth000000.o(.idata$4+0x0): undefined reference to `__nm__error_context_stack'
    Info: resolving _error_context_stack by linking to __imp__error_context_stack (auto-import)
    collect2: ld returned 1 exit status
    dllwrap: gcc exited with status 1

Sounds like a missing DLLIMPORT again.

> [snip]
> I know this is cvs code and it is subjected to this type of problems.

Yup!

> I'd like to know if this is the case or it may be some problem of
> cygwin or my setup here.

The errors from the plpgsql part of your build indicates a potential
problem with your Cygwin setup.  Are you running the latest of the
relevant development tools?

Thanks for the heads up regarding the Cygwin build issues.

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


Re: Compiling cvs code with Cygwin problems

From
"Francisco Figueiredo Jr."
Date:
 --- Jason Tishler <jason@tishler.net> escreveu:
> All,
>
Hi

> PostgreSQL CVS no longer builds cleanly under Cygwin -- although, it
> does so under Linux (no surprise). :,)  My plate is full right now.  So,
> if anyone would like to help fix the Cygwin build, it would be much
> appreciated...
>

:(

> Francisco,
>
> On Sun, Apr 27, 2003 at 11:03:49AM -0300, Francisco Figueiredo Jr. wrote:
> > I tried to compile 7.4 from cvs and I got some problems:
>
> I just tried it myself.  See my comments in-line, below...
>
Ok.

> > The first is the <port/win32defs.h> not found. I couldn't find it
> > anywhere!
>
> Me neither.
>
> > Where can I find it??
>
> Sorry, but I don't know.
>
> > So I commented it out from the header and it started to compile.
>
> I used the following workaround instead:
>
>     touch src/include/port/win32defs.h
>

Much better approach!

> > Later I got linking problems in the ecpg with a lot of unresolved
> > references.
>
> I can confirm the above.
>
> > I could get ride of some of them by including some .o from pgtypeslib
> > dir in the OBJS of Makefile,
>
> I didn't try the above (yet).
>
> > but it still gives me this error:
> >
> > ================
> > make -C ecpglib all
> > make[1]: Entering directory
> `/home/voidmain/PostgresqlCVS/pgsql/src/interfaces/ecpgold/ecpglib'
> > dlltool --export-all --output-def ecpg.def execute.o typename.o ...
> > [snip]
> >
> > descriptor.o(.text+0x102):descriptor.c: undefined reference to
> `__imp__sqlca'
> > descriptor.o(.text+0x7c6):descriptor.c: undefined reference to
> `__imp__sqlca'
> > data.o(.text+0x3ce):data.c: undefined reference to `__imp__sqlca'
> > [snip]
> > connect.o(.text+0xaed):connect.c: undefined reference to
> `_ecpg_compat_mode'
> > misc.o(.text+0x1a):misc.c: undefined reference to `__imp__sqlca'
> > collect2: ld returned 1 exit status
> > dllwrap: gcc exited with status 1
>
> It's just a WAG, but the above smells like missing DLLIMPORTs...
>

Uhmmmmm. Sorry for my ignorance, but what does WAG stand for?


> I do not get the above.  However, I get the following instead:
>
>     dllwrap -o plpgsql.dll --dllname plpgsql.dll --def plpgsql.def ...
>     fu000001.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
>     [snip]
>     fu000006.o(.idata$3+0xc): more undefined references to
> `_libpostgres_a_iname' follow
>     nmth000000.o(.idata$4+0x0): undefined reference to
> `__nm__error_context_stack'
>     Info: resolving _error_context_stack by linking to
> __imp__error_context_stack (auto-import)
>     collect2: ld returned 1 exit status
>     dllwrap: gcc exited with status 1
>
> Sounds like a missing DLLIMPORT again.
>

Uhmmm...
> > [snip]
> > I know this is cvs code and it is subjected to this type of problems.
>
> Yup!
>
> > I'd like to know if this is the case or it may be some problem of
> > cygwin or my setup here.
>
> The errors from the plpgsql part of your build indicates a potential
> problem with your Cygwin setup.  Are you running the latest of the
> relevant development tools?
>

I think so, but I will grab the latest dev tools for sure.

> Thanks for the heads up regarding the Cygwin build issues.
>

You are welcome. I'd like you know I could compile 7.4 from a snapshot from
ftp;postgresql.org in the dev dir. I still got the ecpg problem, but it didn't
have the win32defs.h neither the bison problem.
I created a database and could send some queries from psql :)

Thanks for attention Jason!



=====
Regards,
Francisco Figueiredo Jr.
---
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

_______________________________________________________________________
Yahoo! Mail
O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam.
http://br.mail.yahoo.com/


Re: Compiling cvs code with Cygwin problems

From
Jason Tishler
Date:
Francisco,

On Tue, Apr 29, 2003 at 08:41:08AM -0300, Francisco Figueiredo Jr. wrote:
>  --- Jason Tishler <jason@tishler.net> escreveu:
> > PostgreSQL CVS no longer builds cleanly under Cygwin -- although, it
> > does so under Linux (no surprise). :,)  My plate is full right now.
> > So, if anyone would like to help fix the Cygwin build, it would be
> > much appreciated...
>
> :(

Actually, I found (i.e., made) some time.  It wasn't too bad, so I'm
almost done.  There are only two issues left:

    http://archives.postgresql.org/pgsql-hackers/2003-04/msg00981.php

> > I used the following workaround instead:
> >
> >     touch src/include/port/win32defs.h
>
> Much better approach!

Not really, but this one has been resolved.

> > It's just a WAG, but the above smells like missing DLLIMPORTs...
>
> Uhmmmmm. Sorry for my ignorance, but what does WAG stand for?

See the following:

    http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=wag&Find=Find

> You are welcome. I'd like you know I could compile 7.4 from a snapshot
> from ftp;postgresql.org in the dev dir. I still got the ecpg problem,
> but it didn't have the win32defs.h neither the bison problem.  I
> created a database and could send some queries from psql :)

Thanks for the status report.

> Thanks for attention Jason!

You are very welcome.

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


Re: Compiling cvs code with Cygwin problems

From
Jason Tishler
Date:
Francisco,

On Wed, Apr 30, 2003 at 09:34:27AM -0400, Jason Tishler wrote:
> On Tue, Apr 29, 2003 at 08:41:08AM -0300, Francisco Figueiredo Jr. wrote:
> >  --- Jason Tishler <jason@tishler.net> escreveu:
> > > PostgreSQL CVS no longer builds cleanly under Cygwin -- although,
> > > it does so under Linux (no surprise). :,)  My plate is full right
> > > now.  So, if anyone would like to help fix the Cygwin build, it
> > > would be much appreciated...
> >
> > :(
>
> Actually, I found (i.e., made) some time.  It wasn't too bad, so I'm
> almost done.  There are only two issues left:

I'm happy to report that the following patch:

    http://archives.postgresql.org/pgsql-patches/2003-05/msg00050.php

has been applied and PostgreSQL CVS builds cleanly under Cygwin again.

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

Re: Compiling cvs code with Cygwin problems

From
"Francisco Figueiredo Jr."
Date:
Jason Tishler wrote:

> Francisco,
>
>
> I'm happy to report that the following patch:
>
>     http://archives.postgresql.org/pgsql-patches/2003-05/msg00050.php
>
> has been applied and PostgreSQL CVS builds cleanly under Cygwin again.
>


Thanks Jason!
Yes, I now can compile cleanly postgresql from cvs code from some days
ago with cygwin.
I hope the cvs issue is solved soon, so I can get the more updated code :)


--
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi


Re: Compiling cvs code with Cygwin problems

From
Jason Tishler
Date:
Francisco,

On Wed, Jun 11, 2003 at 10:03:49PM, Francisco Figueiredo Jr. wrote:
> Jason Tishler wrote:
> >I'm happy to report that the following patch:
> >
> >  http://archives.postgresql.org/pgsql-patches/2003-05/msg00050.php
> >
> >has been applied and PostgreSQL CVS builds cleanly under Cygwin
> >again.
>
> Thanks Jason!

You are quite welcome.

> Yes, I now can compile cleanly postgresql from cvs code from some days
> ago with cygwin.

AFAICT, my patch was applied on 2003/5/22.  However, I was not notified
until 2003/6/2 that it was accepted.

> I hope the cvs issue is solved soon, so I can get the more updated
> code :)

Are you referring to anonymous CVS?  If so, then it is working again.
This is another reason why it took me so long to get back to the list
regarding this patch.  Sigh...

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

Re: Compiling cvs code with Cygwin problems

From
"Francisco Figueiredo Jr."
Date:
Jason Tishler wrote:
> Francisco,
>
> On Wed, Jun 11, 2003 at 10:03:49PM, Francisco Figueiredo Jr. wrote:
>
>>Jason Tishler wrote:
>>
>>>I'm happy to report that the following patch:
>>>
>>> http://archives.postgresql.org/pgsql-patches/2003-05/msg00050.php
>>>
>>>has been applied and PostgreSQL CVS builds cleanly under Cygwin
>>>again.
>>
>>Thanks Jason!
>
>
> You are quite welcome.
>

:)

>
>>Yes, I now can compile cleanly postgresql from cvs code from some days
>>ago with cygwin.
>
>
> AFAICT, my patch was applied on 2003/5/22.  However, I was not notified
> until 2003/6/2 that it was accepted.
>
>

Good. I don't remember when I got my cvs code. I'm not with my devel
machine right now, but I think I got you cvs code from 2003/6/2 as it
compiled perfectly with no error :)

>>I hope the cvs issue is solved soon, so I can get the more updated
>>code :)
>
>
> Are you referring to anonymous CVS?  If so, then it is working again.
> This is another reason why it took me so long to get back to the list
> regarding this patch.  Sigh...
>

Good! I tested it yestarday and it was with problems. I will test it
today when I get home.

Thanks Jason for your support!