1
0
mirror of https://github.com/adamyg/mcwin32.git synced 2025-04-18 01:17:37 +03:00
mcwin32/mcwin32/doc/INSTALL.md
adamyg cd8c3be0e0
build-232 (#119)
# upgrades/bug-fixes

  * documentation enhancements
  * mcstart, file-extension utility (#124)
  * MSTerminal maximize disabled (#122)
  * obey NODRIVES group policy (#121)
  * getmntinfo, networked/mapped drive (#120)
  * script enhancements, MC_XDG_OPEN as "start" (#119)
  * non-ascii group name handling (#118)
  * mandoc / mchelp integration (#116)
  * stat/seek64 (#35) and (#89)
  * unzip vfs (#88)
  * mc-wrapper's (#69)
  * ESC timeout, -1 enables an infinite wait (#36)
2025-04-14 21:12:41 +08:00

16 KiB

Midnight Commander Win32

Installation instructions

The project can be built from source, using one of several supported tool-chains. The following environments and toolchains are supported.

  • Microsoft Visual C++ (MSVC) 2015 - 2022; or
  • Open-Watcom (OWC) 1.9 or 2.0; or
  • Mingw64, both 32 and 64 bit targets.

The build status of these packages is below.

Workflow

Prerequisites

To build and install mcwin32, you shall need:

  • Clone of the source repository.
  • A supported operating system; Windows 10 or 11, plus in theory older version XP thru to Windows 7.
  • Git tooling for windows.
  • Perl 5 with core modules, see NOTES-PERL.md.
  • CoreUtils, includes various text and system utilities.
  • Make.
  • An ANSI C/C++ compiler.
  • A development environment in the form of development libraries and C header files.

For additional platform specific requirements, solutions to specific issues and other details, please read one of these:

Plus additional information is available within the GitHub workflows.

Quick Installation Guide

If you just want to get going without bothering too much about the details, here is the short version of how to build and install Midnight Commander Win32.

Confirm both a Perl and tooling which provides CoreUtils and git are installed; for example GIT for Windows. Additional information can be found in later sections.

Create a suitable developer command prompt. If you are using Visual Studio, for example Visual Studio C/C++ 2019, open a "Developer Command Prompt" and issue the following commands:

Clone the github repository

 git clone https://github.com/adamyg/mcwin32.git mc

Change directory to the primary tree

 cd mc\mcwin32

Update external dependencies

 git submodule update --init --recursive

Dependent on the available toolchain, prime using a suitable configuration profile.

 .\support\vc2019config

Several alternative profiles are available:

  • Microsoft Visual C++ (MSVC) 2015 - 2022; or

    • vc2015config - Visual Studio C/C++ 2015.
    • vc2017config - Visual Studio C/C++ 2017.
    • vc2019config - Visual Studio C/C++ 2019.
    • vc2022config - Visual Studio C/C++ 2022.
  • Open-Watcom (OWC) 1.9 or 2.0; or

    • owcconfig - Open Watcom 1.9
    • owc20config - Open Watcom 2.0
  • MingW64, both 32 and 64 bit targets.

    • mingw32config - mingW64 tool-chain.
    • mingw64config - mingW64, 64bit tool-chain.

The resulting build profile and options shall be available.

 -
 -  Configuration:
 -
 -               PackageName: Midnight Commander WIN32
 -                   Version: 4.8.33
 -
 -                 ToolChain: Visual Studio 2019
 -                  Compiler: cl / cl
 -                    CFLAGS: -nologo -MD$(RTSUFFIX) -fp:precise
 -                  CXXFLAGS: -nologo -MD$(RTSUFFIX) -EHsc -fp:precise -Zc:offsetof-
 -                       Release: -O2 -GL -Gy -DNDEBUG
 -                       Debug:   -Zi -RTC1 -Od
 -                   LDFLAGS: -nologo -MD$(RTSUFFIX)
 -
 -
 -      Virtual File Systems: cpio, extfs, shell, ftp, sfs, sftp, tar (see: config.h)
 -            Screen library: console
 -             Mouse support: native
 -          Subshell support: n/a
 -     Background operations: n/a
 -           Internal editor: yes
 -               Diff viewer: yes
 -

 Review the options above for accuracy.

 Execute to build:

    "make release"          - build software.

 To generate an installer:

    "make release package"  - build installer.

 Optionally after installation:

    "make release clean"    - remove build tree.

Once reviewed execute the following:

$ .\support\gmake-42 release

and optionally a local installer

$ .\support\gmake-42 release package

alternatively zip and copy the bin.<toolchain>/release tree to your desired install location.

Tool-chains

The follow offers a more detailed discussion of the requirements and instruction, for each of actively supported tool-chain and third-party tooling solutions:

Native builds using Open-Watcom C/C++

Perl

A Perl installation needs to be available plus the installation should be visible within the current PATH.

Strawberry Perl is recommended, available from http://strawberryperl.com/, as an alternative is ActiveState Perl, https://www.activestate.com/ActivePerl.

Watcom C/C++

Watcom C/C++ (currently Open Watcom C/C++) is an integrated development environment (IDE) product from Watcom International Corporation for the C, C++, and Fortran programming languages. Watcom C/C++ was a commercial product until it was discontinued, then released under the Sybase Open Watcom Public License as Open Watcom C/C++.

Two versions of Open Watcom C/C++ are freely available, the legacy 1.9 version and the current Open 2.0 development stream, both are actively supported. These are available from https://www.openwatcom.org and https://github.com/open-watcom/open-watcom-v2.

Note: Open-Watcom is the current tool-chain published builds utilise.

Binary utilises

In addition to Perl and the selected compiler tool-chain, several utilises are required. Under Unix like environments these are referred to as the binutils package, yet are not generally installed on Windows host.

Minimal tools required are:

  • gmake - GNU make utility.

    make is a utility which can determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them.

  • busybox - The Swiss Army Knife of Embedded Linux

    BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system

  • coreutils - Collection of file and text manipulation utilities; including

    • cp - copy files and directories.

    • mv - move (rename) files.

    • rm - remove files or directories.

    • grep/egrep - print lines that match patterns.

    • gzip, gunzip, zcat - compress or expand files.

    • tar - an archiving utility.

    Coreutils are bundled with GIT for Windows, alternatively install MSYS2.

    Once installed the required commands should be visible within the path.

To support native Windows builds, the make tool gmake-42, web tool wget and the shell support tool busybox are bundled within the source repository sub-directory win32/.

The configure front-end shall attempt to select the most suitable tools available on the build host.

InnoSetup

To package the build application as an installer, Inno Setup is utilised. Inno Setup is a free installer for Windows program's, available from https://jrsoftware.org/.

The Inno package is optional and only required if an installer is being built.

Inno Setup 5.6.x or greater is required. Note 6.x Inno and later shall only function on Vista or greater. 6.x and later versions of Inno no longer support Windows 2000, XP, and Server 2003.

Using Chocolatey, to install Inno Setup, run the following on a command line:

$ choco install innosetup --version=5.6.1

Note: Inno-Setup 5.6.x (Unicode version) is used to package the current installers.

Quick start

  • Install Perl

  • Install Inno-Setup

    Install Inno Setup 5.6.x within its default installation path; if modified the arguments to the support scripts below shall need to be adjusted to match, set the environment variable INNO="<install-path>" prior to priming the tree.

  • Make sure Perl is on your $PATH.

  • Create a Open Watcom command Prompt and confirm that wcl386 is within your path.

    From the source root, a suitable environment can be setup using the one of the following dependent on the desired toolchain, were C:\Watcom is the toolchain installation directory.

    • owcconfig- Open Watcom 1.9
    • owc20config - Open Watcom 2.0
  • From the root of the source directory perform the following:

    • Configure and prime the build system.

      $ .\support\owcconfig C:\Watcom
      
      Note: Optional installation directory
      

      on completion the make system is ready, run only make shall present usage information:

      $ .\support\gmake-42
      
      |
      | make [VERBOSE=1] [release or debug] target
      |
      |       Build one or more of the following targets recursively within each sub-directory
      |       for the toolchain "Visual Studio 2019" (vs160).
      |
      | Options:
      |       VERBOSE - increase run-time diagnostics; suppress stderr filtering.
      |
      | Targets:
      |
      |       build - build everything.
      |       package - build package.
      |       clean - delete everything which can be remade.
      |       vclean - delete all.
      |       help - command line usage.
      .
      
    • Build mcwin32 and associated third-party components.

      $ .\support\gmake-42 release build
      
    • Optionally, build the installer.

      $ .\support\gmake-42 release package
      

      Alternatively zip and copy the bin.<toolchain>/release tree to your desired install location.

The resulting work flow could look like the following, inside a Open Watcom 1.9 developer prompt:

cd c:\projects

git clone https://github.com/adamyg/mcwin32.git mc
 
cd c:\projects\mc\mcwin32

git submodule update --init --recursive

set PERL=c:\Strawberry\perl\bin\perl
set PATH=c:\msys64\usr\bin;%PATH%

.\support\owcconfig

.\support\gmake-42 release
.\support\gmake-42 release package

Native builds using Visual C/C++

Visual C/C++ offers an alternative way to build native mcwin32, similar to Open-Watcom C/C++ builds.

Microsoft Visual is available in several, all are suitable:

  • Microsoft Visual C++ 2015 - 2002 Professional -

    Standard Microsoft Visual C++ installations.

  • Microsoft Visual C++ 2015 - 2022 Community Edition -

    These free versions of Visual C++ 2015-2022 Professional contain the same compilers and linkers that ship with the full versions, and also contain everything necessary to build mcwin32.

  • Microsoft C++ Build Tools -

    There's also a standalone (IDE-less) version of the build tools mentioned above containing the MSVC compiler available for download from https://visualstudio.microsoft.com/visual-cpp-build-tools/.

Note: Since these are proprietary and ever-changing I cannot test them all. Older versions may not work, it is recommended to use a recent version wherever possible.

  • Install Perl

  • Install Inno-Setup

  • Make sure Perl is on your $PATH.

  • Use Visual Studio Developer Command Prompt with administrative privileges, choosing one of its variants depending on the intended architecture. Or run cmd and execute vcvarsall.bat with one of the options x86, x86_amd64, x86_arm, x86_arm64, amd64, amd64_x86, amd64_arm, or amd64_arm64. This all setup the environment variables needed for the compiler cl.exe.

    See also https://docs.microsoft.com/cpp/build/building-on-the-command-line

  • Select a suitable build profile

    • vc2015config - Visual Studio C/C++ 2015.
    • vc2017config - Visual Studio C/C++ 2017.
    • vc2019config - Visual Studio C/C++ 2019.
    • vc2022config - Visual Studio C/C++ 2022.
  • From the root of the source directory perform the following:

    • Configure and prime the build system.

      $ .\support\vc####config
      

      where #### representes the toolchain, for example 2019.

      $ .\support\vc2019config
      
    • Build mcwin32 and associated third-party components.

      $ .\support\gmake-42 release
      
    • Optionally, build the installer.

      $ .\support\gmake-42 release package
      

The resulting work flow could look like the following, inside a 2019 developer prompt:

cd c:\projects

git clone https://github.com/adamyg/mcwin32.git mc
 
cd c:\projects\mc\mcwin32

git submodule update --init --recursive

set PERL=c:\Strawberry\perl\bin\perl
set PATH=c:\msys64\usr\bin;%PATH%

.\support\vc2019config

.\support\gmake-42 release
.\support\gmake-42 release package

Native builds using Mingw

Mingw64 (32/64) offers another alternative way to build native mcwin32, similar to Open-Watcom C/C++ builds.

MSYS2 provides GNU tools, a Unix-like command prompt, and a UNIX compatibility layer for applications, available from https://www.mingw-w64.org. However, in this context it is only used for building mcwin32. The resulting application does not rely on MSYS2 to run and is fully native.

  • MSYS2 shell, from https://www.msys2.org/

  • Perl, at least version 5.10.0, which usually comes pre-installed with MSYS2.

  • Install Inno-Setup

  • Create a MSYS/Mingw64 Command Prompt.

    To install the minimal tools required:

    $ pacman --noconfirm -S base-devel
    

    plus one of the following

    $ pacman --noconfirm -S mingw-w64-x86_64-gcc
    $ pacman --noconfirm -S mingw-w64-i686-gcc
    

    These compilers must be on your MSYS2 $PATH, example below assuming the default installation path c:/msys64/. A common error is to not have these on your $PATH. The MSYS2 version of gcc will not work correctly here.

  • From the root of the source directory perform the following:

    • Configure and prime the build system.

      • x64 tool-chain

          PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin
          $ .\support\mingw64config
        
      • x86 tool-chain.

          PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin
          $ .\support\mingw32config
        
    • Build mcwin32 and associated third-party components.

      $ .\support\gmake-42 release
      
    • Optionally, build the installer.

      $ .\support\gmake-42 release package
      

The resulting work flow could look like the following, inside either a terminal/command or msys prompt:

Install any missing components

c:\msys64\usr\bin\pacman --noconfirm -S base-devel
c:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-i686-gcc
c:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-i686-gettext-tools
c:\msys64\usr\bin\pacman --noconfirm -S zip

Prime sandbox and build

cd c:\projects

git clone https://github.com/adamyg/mcwin32.git mc
 
cd c:\projects\mc\mcwin32

git submodule update --init --recursive

set PERL=c:\Strawberry\perl\bin\perl
set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%

.\support\mingw32config

.\support\gmake-42 release
.\support\gmake-42 release package

Last updated: April/25

-end-