guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile with win32 cross compiling


From: Volker Grabsch
Subject: Re: Guile with win32 cross compiling
Date: Tue, 17 May 2011 01:01:01 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Andy Wingo schrieb:
> On Sat 23 Apr 2011 18:10, Volker Grabsch <address@hidden> writes:
> 
> > Andy Wingo schrieb:
> >> Hmmm.  Well.  We have other code generators in Guile's build system;
> >> notably the configure script (via config.h and other output files).
> >> What do folks think about the attached patch?
> >
> > Please drop me a note when you want me to check your patch,
> > confirming that your work really solves the win32 cross issues.
> 
> Hmm, it should have applied to stable-2.0.  I can commit it if there are
> no objections, as there do not appear to be.  It should fix the
> gen-scmconfig issue.

Okay, so I give it another try.

    git clone http://git.savannah.gnu.org/r/guile.git -b stable-2.0
    cd guile

It seems that your patch is already in there, so no "patch" command
is needed after "git clone". Next steps are autogen/configure/make.
The whole configure command is a bit longer, because unfortunately
we have to tweak some stuff to make it really cross-compile:

   ./autogen.sh
   ./configure --host=i686-pc-mingw32 --disable-shared --without-threads 
scm_cv_struct_timespec=no LIBS='-lunistring -lintl -liconv'
   make

Explanation:

   "--without-threads" is needed because threading is a difficult
   issue that I'd like to deal later with.

   "scm_cv_struct_timespec=no" is needed to ensure that libguile/threads.c
   won't try to use the "struct timespec" from <pthreads.h>, which
   would fail because we don't use pthreads (yet). I think this should
   better be fixed in the source, but this workaround does the trick for now.

   "LIBS='-lunistring -lintl -liconv'" is needed because otherwise,
   the detection of libunistring fails. I think this should better
   be fixed in configure.ac, but this workaround does the trick for now.

In addition, I had to fix two other things in the source. The patches
are attached to this email:

    "fix-include-error-in-gen-scmconfig.patch"
    The patch re-introduces a change which I already proposed
    in my last patch: You can't use $(AM_CPPFLAGS) for the native
    build, because it adds "-I../lib" which means that <stdio.h>
    is taken from the local GNU-lib installation. The problem is
    that the GNU-lib in "lib/" has been configured for MinGW, not
    for the native system. So it performs some fixes which don't
    work on non-MinGW systems, leading to strange, unhelpful error
    messages. It took me quite some time to figure this out, mostly
    because I thought that this should have already been fixed.

    "remove-mingw-ifsock.patch"
    This patch fixes an issue that also appears on native MinGW
    build, because _S_IFSOCK simply isn't defined there. Note that
    this issue was already reported, but hasn't been fixed up to
    now, at least not in the stable-2.0 branch:
    http://lists.gnu.org/archive/html/guile-devel/2011-01/msg00183.html

After those changes, the build continues quite far, but ultimately
fails at the following position:

--------------------------------------------------------------------------
  CC     net_db.lo
net_db.c:460:1: error: 'AI_ALL' undeclared here (not in a function)
net_db.c:460:1: error: expression in static assertion is not an integer
net_db.c:482:33: warning: 'struct addrinfo' declared inside parameter list 
[enabled by default]
net_db.c:482:33: warning: its scope is only this definition or declaration, 
which is probably not what you want [enabled by default]
net_db.c: In function 'scm_from_addrinfo':
net_db.c:490:3: error: dereferencing pointer to incomplete type
net_db.c:491:3: error: dereferencing pointer to incomplete type
net_db.c:492:3: error: dereferencing pointer to incomplete type
net_db.c:493:3: error: dereferencing pointer to incomplete type
net_db.c:494:3: error: dereferencing pointer to incomplete type
net_db.c:494:3: error: dereferencing pointer to incomplete type
net_db.c:496:3: error: dereferencing pointer to incomplete type
net_db.c:496:3: error: dereferencing pointer to incomplete type
net_db.c: In function 'scm_getaddrinfo':
net_db.c:614:19: error: storage size of 'c_hints' isn't known
net_db.c:657:3: warning: implicit declaration of function 'getaddrinfo' 
[-Wimplicit-function-declaration]
net_db.c:665:10: error: dereferencing pointer to incomplete type
net_db.c:665:19: warning: left-hand operand of comma expression has no effect 
[-Wunused-value]
net_db.c:666:2: warning: passing argument 1 of 'scm_from_addrinfo' from 
incompatible pointer type [enabled by default]
net_db.c:482:1: note: expected 'const struct addrinfo *' but argument is of 
type 'struct addrinfo *'
net_db.c:668:7: warning: implicit declaration of function 'freeaddrinfo' 
[-Wimplicit-function-declaration]
net_db.c:614:19: warning: unused variable 'c_hints' [-Wunused-variable]
net_db.c: At top level:
net_db.c:680:1: error: 'EAI_BADFLAGS' undeclared here (not in a function)
net_db.c:680:1: error: expression in static assertion is not an integer
net_db.c: In function 'scm_gai_strerror':
net_db.c:744:3: warning: implicit declaration of function 'gai_strerror' 
[-Wimplicit-function-declaration]
net_db.c:744:3: warning: passing argument 1 of 'scm_from_locale_string' makes 
pointer from integer without a cast [enabled by default]
../libguile/strings.h:134:13: note: expected 'const char *' but argument is of 
type 'int'
In file included from net_db.c:755:0:
../libguile/net_db.x: In function 'scm_init_net_db':
../libguile/net_db.x:17:78: error: 'AI_PASSIVE' undeclared (first use in this 
function)
../libguile/net_db.x:17:78: note: each undeclared identifier is reported only 
once for each function it appears in
../libguile/net_db.x:18:82: error: 'AI_CANONNAME' undeclared (first use in this 
function)
../libguile/net_db.x:19:86: error: 'AI_NUMERICHOST' undeclared (first use in 
this function)
../libguile/net_db.x:20:86: error: 'AI_NUMERICSERV' undeclared (first use in 
this function)
../libguile/net_db.x:21:80: error: 'AI_V4MAPPED' undeclared (first use in this 
function)
../libguile/net_db.x:23:84: error: 'AI_ADDRCONFIG' undeclared (first use in 
this function)
../libguile/net_db.x:27:78: error: 'EAI_NONAME' undeclared (first use in this 
function)
../libguile/net_db.x:28:76: error: 'EAI_AGAIN' undeclared (first use in this 
function)
../libguile/net_db.x:29:74: error: 'EAI_FAIL' undeclared (first use in this 
function)
../libguile/net_db.x:30:78: error: 'EAI_FAMILY' undeclared (first use in this 
function)
../libguile/net_db.x:31:82: error: 'EAI_SOCKTYPE' undeclared (first use in this 
function)
../libguile/net_db.x:32:80: error: 'EAI_SERVICE' undeclared (first use in this 
function)
../libguile/net_db.x:33:78: error: 'EAI_MEMORY' undeclared (first use in this 
function)
../libguile/net_db.x:34:78: error: 'EAI_SYSTEM' undeclared (first use in this 
function)
../libguile/net_db.x:35:82: error: 'EAI_OVERFLOW' undeclared (first use in this 
function)
make[3]: *** [net_db.lo] Error 1
--------------------------------------------------------------------------


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---

Attachment: fix-include-error-in-gen-scmconfig.patch
Description: Text Data

Attachment: remove-mingw-ifsock.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]