unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Volker Grabsch <vog@notjusthosting.com>
To: Andy Wingo <wingo@pobox.com>
Cc: bug-guile@gnu.org, guile-devel@gnu.org
Subject: Re: Guile with win32 cross compiling
Date: Tue, 17 May 2011 01:01:01 +0200	[thread overview]
Message-ID: <20110516230101.GB3311@flap> (raw)
In-Reply-To: <m3bozwdj75.fsf@unquote.localdomain>

[-- Attachment #1: Type: text/plain, Size: 7005 bytes --]

Andy Wingo schrieb:
> On Sat 23 Apr 2011 18:10, Volker Grabsch <vog@notjusthosting.com> 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 #2: fix-include-error-in-gen-scmconfig.patch --]
[-- Type: text/x-diff, Size: 432 bytes --]

--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -57,7 +57,7 @@ gen_scmconfig_SOURCES = gen-scmconfig.c
 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
 	$(AM_V_GEN) \
 	if [ "$(cross_compiling)" = "yes" ]; then \
-		$(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
+		$(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_srcdir) -I$(top_builddir) -c -o $@ $<; \
 	else \
 		$(COMPILE) -c -o $@ $<; \
 	fi

[-- Attachment #3: remove-mingw-ifsock.patch --]
[-- Type: text/x-diff, Size: 469 bytes --]

--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -473,7 +473,7 @@ static int fstat_Win32 (int fdes, struct stat *buf)
   /* Is this a socket ? */
   if (getsockopt (fdes, SOL_SOCKET, SO_ERROR, (void *) &error, &optlen) >= 0)
     {
-      buf->st_mode = _S_IFSOCK | _S_IREAD | _S_IWRITE | _S_IEXEC;
+      buf->st_mode = _S_IREAD | _S_IWRITE | _S_IEXEC;
       buf->st_nlink = 1;
       buf->st_atime = buf->st_ctime = buf->st_mtime = time (NULL);
       return 0;

  reply	other threads:[~2011-05-16 23:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 22:06 Guile with win32 cross compiling Volker Grabsch
2011-04-01 10:38 ` Andy Wingo
2011-04-01 18:50   ` Volker Grabsch
2011-04-12 11:14     ` Andy Wingo
2011-04-23 16:10       ` Volker Grabsch
2011-04-24 10:42         ` Andy Wingo
2011-05-16 23:01           ` Volker Grabsch [this message]
2011-05-20 10:32             ` Andy Wingo
2011-05-20 12:25               ` Volker Grabsch
2011-05-20 12:48                 ` Jan Nieuwenhuizen
2011-05-20 13:25                   ` Andy Wingo
2011-05-20 22:19                   ` Volker Grabsch
2011-06-17  9:03                     ` Andy Wingo
2011-07-01 13:52                       ` Andy Wingo
2011-04-24 20:22       ` Ludovic Courtès
2011-04-28 21:03         ` Andy Wingo
2011-06-19 14:42           ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2011-04-05 19:43 Mike Gran
2011-04-06  1:38 ` Volker Grabsch
2011-04-06 12:46   ` Ludovic Courtès
2011-03-26 22:04 Volker Grabsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110516230101.GB3311@flap \
    --to=vog@notjusthosting.com \
    --cc=bug-guile@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).