Subject: Re: bug#22240: Build instructions for 64-bit Windows?

From: Eli Zaretskii <[email-masked]>
Date: Sat, 26 Dec 2015 10:58:12 +0200

> From: Brian Burns <[email-masked]>
> Date: Fri, 25 Dec 2015 16:49:55 -0600
> 
> I noticed recently that Emacs didn't have any build instructions for 64-bit
> Windows - I tried the instructions for the 32-bit build in nt/INSTALL last
> year [1] but something went wrong at some point (I don't remember what,
> exactly). I tried again recently using the instructions from the Emacs-w64
> project [2] which uses MSYS2 and MinGW-w64 - it worked well and it was also
> easier to get the necessary libraries, as it has a package manager, pacman.
> 
> So I thought I would try adapting those instructions to include with Emacs, if
> it would be helpful - the author Chris Zheng said he wouldn't mind, and I could
> post it here or the devlist for feedback - it could go in a separate INSTALL64
> document, if the existing one is too long.

It's OK to have a separate file, but then nt/INSTALL should say right
at the beginning that instructions for a 64-bit build are in that
file.

Also, if we are going to install this, we will need the full name and
email address of Chris Zheng, to give him credit.  The instructions
are short enough to consider them a "tiny change", so no legal
paperwork is necessary in this case.

> Are there any issues with using MSYS2 over MSYS? I think you can build a 32-bit
> Emacs with MSYS2 also, but I'm not sure - if so it would be possible to cover
> both with one document, which might be simpler, but I could start with the
> 64-bit instructions anyway.

I'm okay with saying that MSYS2 instructions cover the 32-bit build as
well, but they require installing a different toolchain, so I think
the current instructions should stay, at least for those who prefer
mingw.org's tools and the optional libraries pointed to in INSTALL,
which were all compiled using mingw.org's tools (I have no idea
whether some subtle incompatibilities might exist between the binaries
produced by the two toolchains).

> [1] https://github.com/emacs-mirror/emacs/blob/master/nt/INSTALL
> [2]
> http://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/

Finally, I have some comments on the MSYS2 instructions, if they are
to be added to the repository:

  . The "Get the source code" section should be rewritten to cater
    both to those who build from the Git repository (and it's better
    to refer those to the corresponding Savannah page, like nt/INSTALL
    does, than to repeat the URL, which might become outdated, in the
    file), and those who build from a source tarball of an official
    release.

  . The "configure; make; make install" section should avoid showing
    non-essential switches to configure, except as an example: users
    should decide by themselves what switches to use.  Specifically:

    . the --host, --target, and --build switches should not be needed
      at all, ever
    . the --with-wide-int switch is a no-op in a 64-bit build
    . the --with-png and other similar switches should not be used at
      all, since configure will detect whatever libraries are
      available by default (only the corresponding --without-FOO
      switches should ever be used to _disable_ a package that would
      otherwise be detected)
    . the --prefix should be on the configure command, and it should
      NOT advise any particular location (there's a discussion in
      nt/INSTALL where PREFIX should be, and I suggest to either
      repeat it or point to it, because I believe the same
      considerations are valid for a MinGW64 build; if MinGW64 has a
      popular location of the root of its tree, the preferred PREFIX
      should use it)
    . the 'cp' commands I don't understand at all: if PREFIX is chosen
      correctly, the Emacs's bin/ directory and the MinGW64's bin/
      directory should be the same, so there's no need to copy; and
      even if these two bin/ directories are different, the directory
      with DLLs should be on PATH.  this sounds like some workaround
      for some misconfiguration, so we had better not repeated that.

  . The "Run" section doesn't belong in installation instructions.

I invite people who use MinGW64 to build Emacs to please send their
comments and observations about the build, so that they could be
reflected in what we install, if needed.

Thanks.