unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Christoph Buck <christoph.buck@smartoptics.de>
To: Mike Gran <spk121@yahoo.com>
Cc: guile-devel@gnu.org
Subject: Re: Compiling guile-2.2.4 for mingw
Date: Tue, 20 Nov 2018 18:16:32 +0100	[thread overview]
Message-ID: <xxtin0rk6tr.fsf@smartoptics.de> (raw)
In-Reply-To: <20181120155813.GA20667@joshua.dnsalias.com> (Mike Gran's message of "Tue, 20 Nov 2018 07:59:44 -0800")

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

Mike Gran <spk121@yahoo.com> writes:

> Hey Chris,
>
> This is one of two errors.  One problem is that Guile makes assumptions
> about the size of long vs the size of a pointer, as do some the
> libraries on which Guile depends.  In practice, your Guile needs to be
> compiled under MinGW 32-bit where sizeof(void *) == sizeof(long)

Ok that makes sense.

> There is another error that causes similar problems to the one you are
> seeing.  That error is because there is an error in Guile that under
> MinGW where it saves temporary files generated by 'mkstemp!' using the
> text encoding, so you end up with random carriage returns in your
> compiled scheme files.

I already wondered why my file-pathes were messed up.

> I do have a working mostly working MinGW Guile on my system.  You can
> check out the patches I did on a branch of the repo called
> wip-mingw-guile-2.2
>
> git.savannah.gnu.org/cgit/guile.git/log/?h=wip-mingw-guile-2.2
>
> At the beginning of the year, I think I submitted the first of these
> patches upstream, but, I got around to submitting the rest of them.
>
Ok i checked out your branch and it indeed seems to compile under
mingw32. However, I needed to comment out the pollfd struct definition in
lib/poll.in.h to prevent a collusion in the winsock2.h header (see
attached patch file). I guess this can be fixed more adequate somewhere
in the configure scripts? 

> Also note that the MinGW threading library (winpthreads) almost works
> with garbage collection, but, it isn't 100%, so you may need to only
> compile the single-threaded version of Guile.

Ok good to know.

Is there currently no way to get guile running under mingw-64bit? My plan
was to integrate guile in a project of mine which currently only builds
under 64bit.

> Good luck,
>
> Mike
>

Thanks

Christoph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: poll.in.h.patch --]
[-- Type: text/x-patch, Size: 2377 bytes --]

--- lib/poll.in.h.orig	2018-11-20 17:58:03.317863600 +0100
+++ lib/poll.in.h	2018-11-20 17:58:35.920887000 +0100
@@ -55,12 +55,12 @@
 
 # if !GNULIB_defined_poll_types
 
-struct pollfd
-{
-  int fd;                       /* which file descriptor to poll */
-  short events;                 /* events we are interested in   */
-  short revents;                /* events found on return        */
-};
+/* struct pollfd */
+/* { */
+/*   int fd;                       /\* which file descriptor to poll *\/ */
+/*   short events;                 /\* events we are interested in   *\/ */
+/*   short revents;                /\* events found on return        *\/ */
+/* }; */
 
 typedef unsigned long nfds_t;
 
@@ -75,28 +75,28 @@
 #endif
 
 
-#if @GNULIB_POLL@
-# if @REPLACE_POLL@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#   undef poll
-#   define poll rpl_poll
-#  endif
-_GL_FUNCDECL_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
-_GL_CXXALIAS_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
-# else
-#  if !@HAVE_POLL@
-_GL_FUNCDECL_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
-#  endif
-_GL_CXXALIAS_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
-# endif
-_GL_CXXALIASWARN (poll);
-#elif defined GNULIB_POSIXCHECK
-# undef poll
-# if HAVE_RAW_DECL_POLL
-_GL_WARN_ON_USE (poll, "poll is unportable - "
-                 "use gnulib module poll for portability");
-# endif
-#endif
+/* #if @GNULIB_POLL@ */
+/* # if @REPLACE_POLL@ */
+/* #  if !(defined __cplusplus && defined GNULIB_NAMESPACE) */
+/* #   undef poll */
+/* #   define poll rpl_poll */
+/* #  endif */
+/* _GL_FUNCDECL_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout)); */
+/* _GL_CXXALIAS_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout)); */
+/* # else */
+/* #  if !@HAVE_POLL@ */
+/* _GL_FUNCDECL_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout)); */
+/* #  endif */
+/* _GL_CXXALIAS_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout)); */
+/* # endif */
+/* _GL_CXXALIASWARN (poll); */
+/* #elif defined GNULIB_POSIXCHECK */
+/* # undef poll */
+/* # if HAVE_RAW_DECL_POLL */
+/* _GL_WARN_ON_USE (poll, "poll is unportable - " */
+/*                  "use gnulib module poll for portability"); */
+/* # endif */
+/* #endif */
 
 
 #endif /* _@GUARD_PREFIX@_POLL_H */


  reply	other threads:[~2018-11-20 17:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 14:31 Compiling guile-2.2.4 for mingw Christoph Buck
2018-11-20 15:39 ` tomas
2018-11-20 15:59 ` Mike Gran
2018-11-20 17:16   ` Christoph Buck [this message]
2018-11-20 17:45     ` Mike Gran
2018-11-20 20:27       ` Mark H Weaver
2018-11-20 17:10 ` Eli Zaretskii
2018-11-20 17:53 ` Jan Nieuwenhuizen

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=xxtin0rk6tr.fsf@smartoptics.de \
    --to=christoph.buck@smartoptics.de \
    --cc=guile-devel@gnu.org \
    --cc=spk121@yahoo.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).