From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#10474: Building guile 2.x under mingw + msys Date: Wed, 25 Jan 2012 22:12:04 +0100 Message-ID: <87k44ffpwb.fsf@gnu.org> References: <87pqerdxq4.fsf@pobox.com> <83ehuy698u.fsf@gnu.org> <8362ga5h7h.fsf@gnu.org> <87r4ywpnv0.fsf@gnu.org> <83obtz4muv.fsf@gnu.org> <83r4yt2tyj.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327525965 20558 80.91.229.12 (25 Jan 2012 21:12:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2012 21:12:45 +0000 (UTC) Cc: 10474@debbugs.gnu.org, commander.sirow@googlemail.com To: Eli Zaretskii Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Jan 25 22:12:40 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RqA92-00011p-8t for guile-bugs@m.gmane.org; Wed, 25 Jan 2012 22:12:40 +0100 Original-Received: from localhost ([::1]:50737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqA91-0004r6-Kl for guile-bugs@m.gmane.org; Wed, 25 Jan 2012 16:12:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqA8y-0004qi-BY for bug-guile@gnu.org; Wed, 25 Jan 2012 16:12:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqA8w-0002T7-HZ for bug-guile@gnu.org; Wed, 25 Jan 2012 16:12:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqA8w-0002T2-Eb for bug-guile@gnu.org; Wed, 25 Jan 2012 16:12:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RqA9O-0007bm-7d for bug-guile@gnu.org; Wed, 25 Jan 2012 16:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 25 Jan 2012 21:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10474 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 10474-submit@debbugs.gnu.org id=B10474.132752596329219 (code B ref 10474); Wed, 25 Jan 2012 21:13:02 +0000 Original-Received: (at 10474) by debbugs.gnu.org; 25 Jan 2012 21:12:43 +0000 Original-Received: from localhost ([127.0.0.1]:43936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqA94-0007bD-GU for submit@debbugs.gnu.org; Wed, 25 Jan 2012 16:12:43 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:12870) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqA91-0007b0-V8 for 10474@debbugs.gnu.org; Wed, 25 Jan 2012 16:12:41 -0500 X-IronPort-AV: E=Sophos;i="4.71,570,1320620400"; d="scan'208";a="141437857" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 25 Jan 2012 22:12:05 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 =?UTF-8?Q?Pluvi=C3=B4se?= an 220 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <83r4yt2tyj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jan 2012 13:09:08 +0200") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6083 Archived-At: Hi Eli, Thanks for doing all the hard work! I=E2=80=99m willing to apply your changes, but could you send them in =E2= =80=98git format-patch=E2=80=99 format, with a log in GNU ChangeLog style, to make it easier? In prevision of the of an increased contribution rate ;-), could you assign copyright to the FSF? At first sight, these patches may be applicable without copyright assignment, but that=E2=80=99s the limit, I th= ink. Eli Zaretskii skribis: > 1. Compilation warnings in deprecation.c: > > SNARF deprecation.x > deprecation.c:40:1: warning: "vsnprintf" redefined > In file included from deprecation.c:25: > ../lib/stdio.h:1605:1: warning: this is the location of the previous= definition > > This is because deprecation.c does this: > > /* Windows defines. */ > #ifdef __MINGW32__ > #define vsnprintf _vsnprintf > #endif > > but lib/stdio.h already did the same. My solution was to add an > "#ifdef vsnprintf" condition to deprecation.c to avoid redefinition. > > 2. Compilation warning in expand.c: > > SNARF expand.x > expand.c:52:1: warning: "VOID" redefined > In file included from d:/usr/include/windef.h:253, > from d:/usr/include/windows.h:48, > from d:/usr/include/winsock2.h:22, > from ../libguile/iselect.h:36, > from ../libguile/threads.h:30, > from ../libguile/gc.h:29, > from ../libguile/_scm.h:75, > from expand.c:27: > d:/usr/include/winnt.h:75:1: warning: this is the location of the pr= evious definition > expand.c:54:1: warning: "CONST" redefined > In file included from d:/usr/include/windows.h:48, > from d:/usr/include/winsock2.h:22, > from ../libguile/iselect.h:36, > from ../libguile/threads.h:30, > from ../libguile/gc.h:29, > from ../libguile/_scm.h:75, > from expand.c:27: > d:/usr/include/windef.h:39:1: warning: this is the location of the p= revious definition > > This is because expand.c does: > > #define VOID(src) \ > SCM_MAKE_EXPANDED_VOID(src) > #define CONST(src, exp) \ > SCM_MAKE_EXPANDED_CONST(src, exp) > > and Windows headers have their own definitions for VOID and CONST. > > My solution was to add this to expand.c: > > #ifdef VOID > #undef VOID > #endif > #ifdef CONST > #undef CONST > #endif > > However, I really suggest that expand.c uses some less ubiquitous > symbol names, like SCM_CONST and SCM_VOID. > > 3. Compilation warning in filesys.c: > > SNARF filesys.x > filesys.c:119:1: warning: "mkdir" redefined > In file included from ../lib/sys/stat.h:47, > from filesys.c:92: > ../lib/sys/stat.h:808:1: warning: this is the location of the previo= us definition > > This is because filesys.c does this: > > /* Some more definitions for the native Windows port. */ > #ifdef __MINGW32__ > # define mkdir(path, mode) mkdir (path) > > But gnulib already redirected `mkdir' to its replacement function. My > solution: don't define if already redirected. To that end, I added > the following condition before the above #define: > > /* When configured to use the gnulib replacement, don't redefine > mkdir, as it is already redirected to the replacement, see > lib/sys/stat.h. */ > # if !GNULIB_defined_rpl_mkdir > > I'm not sure using GNULIB_defined_rpl_mkdir is TRT here, but I didn't > find a better way. Strangely enough, the cross-build to MinGW32 at is not showing any of these. Any idea why? That=E2=80=99s with MinGW 3.18. > 4. Missing setenv needed by dynl.c: > > CC dynl.lo > dynl.c: In function `augment_env': > dynl.c:141: warning: implicit declaration of function `setenv' > > Solution: add a setenv implementation. However, I think Guile would > be better off using a more portable putenv instead. I=E2=80=99ll try Gnulib=E2=80=99s setenv module. > 5. Compilation error in net_db.c: [...] > is inappropriate when gnulib was used to wrap Windows socket > functions. When gnulib _is_ used, the missing macros are already > defined by lib/sys/socket.h. Therefore, I modified the condition to: > > #if HAVE_WINSOCK2_H && !GNULIB_TEST_SOCKET > #include > # if HAVE_WS2TCPIP_H > # include > # endif > #else > #include > #include > #include > #include > #endif > > using GNULIB_TEST_SOCKET as evidence that gnulib is being used. I'm > not sure GNULIB_TEST_SOCKET is TRT, but I saw no better candidate. > Maybe gnulib should provide us with a better macro. This seems to be the right thing, according to gnulib-common.m4: --8<---------------cut here---------------start------------->8--- # gl_MODULE_INDICATOR_FOR_TESTS([modulename]) # defines a C macro indicating the presence of the given module # in lib or tests. This is useful to determine whether the module # should be tested. # | Value | Value | # | in lib/ | in tests/ | # --------------------------------------------+---------+-----------+ # Module present among main modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module present among tests-related modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module not present at all: | 0 | 0 | # --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], [Define to 1 when the gnulib module $1 should be tested.]) ]) --8<---------------cut here---------------end--------------->8--- Thanks! Ludo=E2=80=99.