pg.ddx.io pgsql-ports@postgresql.org mailing list archive
help / color / mirror / Atom feedCross-compiling under linux for Windows
2+ messages / 1 participants
[nested] [flat]
* Cross-compiling under linux for Windows
@ 2006-06-28 09:09 Markku Tavasti <tavasti@tavastisolutions.com>
0 siblings, 1 reply; 2+ messages in thread
From: Markku Tavasti @ 2006-06-28 09:09 UTC (permalink / raw)
To: pgsql-ports
I'm trying to cross-compile postgresql-8.1.4 for windows under Debian
Linux. This is how I've tried to run configure:
CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib ./configure \
--prefix=/usr/local/stow/pg-msw-8.0.4/msw-dev/ --host i586-pc-mingw32 \
--without-zlib --disable-shared
However, not very successfully:
- I have to run i586-mingw32msvc-ranlib manually for
src/port/libpgport.a and src/port/libpgport_srv.a
- have to edit few makefiles to change windres to 586-mingw32msvc-windres
And still, no go:
i586-mingw32msvc-gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing initdb.o win32ver.o -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port -Wl,--allow-multiple-definition -lpgport -lwsock32 -lm -lws2_32 -lshfolder -o initdb.exe
initdb.o:initdb.c:(.text+0x18a0): undefined reference to `_pqsignal'
initdb.o:initdb.c:(.text+0x227c): undefined reference to `_pg_char_to_encoding'
initdb.o:initdb.c:(.text+0x2292): undefined reference to `_pg_valid_server_encoding'
initdb.o:initdb.c:(.text+0x250e): undefined reference to `_pqsignal'
initdb.o:initdb.c:(.text+0x251c): undefined reference to `_pqsignal'
initdb.o:initdb.c:(.text+0x252a): undefined reference to `_pqsignal'
initdb.o:initdb.c:(.text+0x2538): undefined reference to `_pqsignal'
initdb.o:initdb.c:(.text+0x2543): undefined reference to `_pqsignal'
collect2: ld returned 1 exit status
make[3]: *** [initdb] Error 1
make[3]: Leaving directory `/home/tavasti/work/postgres/postgresql-8.1.4/src/bin/initdb'
In fact all I would essentially need is static libpq.a, but even that doesn't
look very good:
-rw-rw-r-- 1 tavasti tavasti 8 Jun 28 10:55 libpq.a
--
M. Tavasti / tavasti@tavastisolutions.com / +358-40-5078254
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Cross-compiling under linux for Windows
@ 2006-07-06 14:48 Markku Tavasti <tavasti@tavastisolutions.com>
parent: Markku Tavasti <tavasti@tavastisolutions.com>
0 siblings, 0 replies; 2+ messages in thread
From: Markku Tavasti @ 2006-07-06 14:48 UTC (permalink / raw)
To: pgsql-ports
Markku Tavasti <tavasti@tavastisolutions.com> writes:
> - I have to run i586-mingw32msvc-ranlib manually for
> src/port/libpgport.a and src/port/libpgport_srv.a
> - have to edit few makefiles to change windres to 586-mingw32msvc-windres
>
> In fact all I would essentially need is static libpq.a, but even that doesn't
> look very good:
>
> -rw-rw-r-- 1 tavasti tavasti 8 Jun 28 10:55 libpq.a
At least one problem was here:
0
tavasti@aladobix:~/work/postgres/postgresql-8.1.4/src/interfaces/libpq$make
ar crs libpq.a `lorder fe-auth.o fe-connect.o fe-exec.o fe-misc.o \
fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o \
pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o \
pgstrcasecmp.o thread.o crypt.o inet_aton.o getaddrinfo.o open.o \
snprintf.o win32.o libpqrc.o | tsort`
nm: fe-auth.o: File format not recognized ...
Running lorder to find what to link is problem. lorder did not
understand file format, so nothing get's into the library.
This works:
ar crs libpq.a fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o \
fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o \
fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o \
thread.o crypt.o inet_aton.o getaddrinfo.o open.o snprintf.o win32.o \
libpqrc.o
So I got what I needed, so I didn't start checking whole build system
to make it cross-compiling compatible. Hopefully this helps someone
else in future.
--
M. Tavasti / tavasti@tavastisolutions.com / +358-40-5078254
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-07-06 14:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-28 09:09 Cross-compiling under linux for Windows Markku Tavasti <tavasti@tavastisolutions.com>
2006-07-06 14:48 ` Markku Tavasti <tavasti@tavastisolutions.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox