From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18302: MSYS2 build issues Date: Wed, 20 Aug 2014 19:26:16 +0300 Message-ID: <83zjezb00n.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1408552047 709 80.91.229.3 (20 Aug 2014 16:27:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2014 16:27:27 +0000 (UTC) Cc: chriszheng99@gmail.com, 18302@debbugs.gnu.org To: Karol Ostrovsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 20 18:27:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XK8jJ-0000ex-7Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Aug 2014 18:27:21 +0200 Original-Received: from localhost ([::1]:56624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK8jI-000484-Nd for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Aug 2014 12:27:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK8j8-000477-JF for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 12:27:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK8j1-00043t-1W for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 12:27:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK8j0-00043o-U6 for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 12:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XK8j0-00018z-IH for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 12:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Aug 2014 16:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18302 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18302-submit@debbugs.gnu.org id=B18302.14085519924354 (code B ref 18302); Wed, 20 Aug 2014 16:27:02 +0000 Original-Received: (at 18302) by debbugs.gnu.org; 20 Aug 2014 16:26:32 +0000 Original-Received: from localhost ([127.0.0.1]:48349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK8iV-000189-Lv for submit@debbugs.gnu.org; Wed, 20 Aug 2014 12:26:32 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:39974) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK8iR-00017o-F9 for 18302@debbugs.gnu.org; Wed, 20 Aug 2014 12:26:29 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NAM00K0058YAM00@mtaout24.012.net.il> for 18302@debbugs.gnu.org; Wed, 20 Aug 2014 19:21:48 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAM00A465GBL5A0@mtaout24.012.net.il>; Wed, 20 Aug 2014 19:21:48 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92543 Archived-At: > Date: Wed, 20 Aug 2014 11:54:53 +0200 > From: Karol Ostrovsky > Cc: Chris Zheng > > thanks to the work of Chris Zheng and Eli Zaretskii we can build Emacs > on MSYS2 with MinGW-w64. However, the process is not completely > painless: xpm support needs manual tweaking of CFLAGS, configure > script must be run with special flags, and make sometimes crashes for > the "emacs$(EXEEXT)" target. What do you mean by "make crashes"? Can you show some messages or other evidence of these crashes? > I am submitting my proposed fixes for these three issues (based on the > latest trunk version of Emacs). With this fix I can successfully > compile 64-bit Emacs using MSYS2 and MinGW-w64 with automatic xpm > support, and the process follows the same easy steps as described in > nt/INSTALL (just running ./autogen.sh, ./configure --prefix=..., and > make). I intend to submit some additional MSYS2+MinGW-w64 > documentation (file nt/INSTALL) should this patch be accepted. Thanks. First, I don't see your name on file with the FSF copyright assignments. Without that, we will be unable to accept substantial contributions such as this one. Would you be willing to sign the necessary legal papers (assuming you are the sole author of these changes)? I have a few questions/comments about your suggested changes. (In the future, please always send diffs obtained by "bzr diff" or "diff -u", not entire files.) > - *-mingw32 ) > - opsys=mingw32 > + *-mingw* ) > + opsys=mingw This change from "mingw32" to "mingw" causes a lot of changes all over. is it really necessary? Is there a problem to call the system "mingw32"? It's just a value of a variable, with no other meaning. Without changing "mingw32" to "mingw", the changes are small enough to not require legal papers (but you might need them anyway further down the road, if you intend to submit more patches). > -if test "$opsys" = "mingw32"; then > - case "$canonical" in > - x86_64-*-mingw32) C_SWITCH_SYSTEM="-mtune=generic" ;; > - *) C_SWITCH_SYSTEM="-mtune=pentium4" ;; > - esac > +if test "$opsys" = "mingw"; then > + C_SWITCH_SYSTEM="-mtune=generic" Why do you want to change the -mtune switch for the 32-bit build? It is by default configured to Pentium 4 so that the resulting binary could run on Windows 9X, which we still support. Users that want to produce binaries tuned to more modern CPUs for their own consumption can always do that by asking for custom CFLAGS. > ### slightly different requirements wrt image libraries (it doesn't > ### use -lXpm because it loads the xpm shared library dynamically at > ### run time). > -if test "${opsys}" = "mingw32"; then > +if test "${opsys}" = "mingw"; then > if test "${with_xpm}" != "no"; then > + CPPFLAGS="$CPPFLAGS -I/mingw64/include/noX" > AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [ Why do you need to add this switch to CPPFLAGS? Why cannot the XPM header files be installed in the default include tree? > @@ -435,8 +435,7 @@ > else \ > LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \ > test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \ > - rm -f bootstrap-emacs$(EXEEXT); \ > - ln emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ > + ln -vf emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ > fi This is a general (not MinGW-specific) part of src/Makefile.in, so I'm not sure we should be changing it. In particular, I'm not sure non-GNU 'ln' supports these 2 switches (and why do you need -v anyway?). Also, I don't understand why this solves anything. If "rm -f" fails, presumably because bootstrap-emacs.exe is still running, so will, or might, "ln -f". And the failure is not fatal: just type "make" again, and it runs to completion. Thanks again for working on this.