### 5.4 Cygwin/64
Please note that the platform Cygwin/32 is obsolete and superceded by Cygwin/64.
Download: [https://cygwin.com/install.html](https://cygwin.com/install.html) and run setup-x86_64.exe. I install into c:\\cygwin64
You need:
make, cmake, curl, gcc, gettext-devel pkg-config, dos2unix, tar, zlib-devel, libexpat1-devel, git, python3-interpreter, libiconv, libxml2-utils, libncurses
To build unit tests, you should install googletest-release-1.8.0 as discussed [4.3 Unit tests](#4-3)
I use the following batch file "cygwin64.bat" to start the Cygwin/64 bash shell from the Dos Command Prompt (cmd.exe).
```bat
@echo off
setlocal
set "PATH=c:\cygwin64\usr\local\bin;c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\cygwin64\usr\sbin;"
if NOT EXIST %HOME% mkdir %HOME%
set "HOME=c:\cygwin64\home\rmills"
cd %HOME%
set "PS1=\! CYGWIN64:\u@\h:\w \$ "
bash.exe -norc
endlocal
```
[TOC](#TOC)
### 5.5 Microsoft Visual C++
We recommend that you use Conan to build Exiv2 using Microsoft Visual C++. Exiv2 v0.27 can be built with Visual Studio versions 2008 and later. We actively support and build with Visual Studio 2015, 2017 and 2019.
As well as Microsoft Visual Studio, you will need to install CMake, Python3, and Conan.
1) Binary installers for CMake on Windows are availably from [https://cmake.org/download/](https://cmake.org/download/).
2) Binary installers for Python3 are available from [python.org](https://python.org)
3) Conan can be installed using python/pip. Details in [README-CONAN.md](README-CONAN.md)
I use the following batch file `cmd64.bat` to start cmd.exe. I do this to reduce the complexity of the path which grows as various tools are installed on Windows. As well as providing a "stripped down path", it also ensures the DOS python3 and DOS bash are on the path.
```bat
@echo off
setlocal
set "P="
set "P=%P%C:\Python37\;C:\Python37\Scripts;" # DOS Python3
set "P=%P%c:\Program Files\cmake\bin;" # DOS cmake
set "P=%P%c:\msys64\usr\bin;" # MinGW/msys2 make, bash etc
set "P=%P%c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin;"
set "P=%P%c:\Windows\System32;" # windows
set "P=%P%%USERPROFILE%\com;" # my home-made magic
set "PATH=%P%"
cmd /S /K cd "%USERPROFILE%\gnu\github\exiv2\0.27-maintenance\"
endlocal
```
**Caution:** _The python3 interpreter must be for DOS and called python3.exe. I copied the python.exe program:_
```
..>copy c:\Python37\python.exe c:\Python37\python3.exe
```
[TOC](#TOC)
### 5.6 Unix
Exiv2 can be built on many Unix and Linux distros. With v0.27.2, we are starting to actively support the Unix Distributions NetBSD and FreeBSD. For v0.27.3, I have added support for Solaris 11.4
We do not have CI support for these platforms on GitHub. However, I regularly build and test them on my MacMini Buildserver. The device is private and not on the internet.
I have provided notes here based on my experience with these platforms. Feedback is welcome. I am willing to support Exiv2 on other commercial Unix distributions such as AIX, HP-UX and OSF/1 if you provide with an ssh account for your platform. I will require super-user privileges to install software.
For all platforms you will need the following components to build:
1. gcc or clang
2. cmake
3. bash
4. sudo
5. gettext
To run the test suite, you need:
1. python3
2. chksum
3. dos2unix
4. xmllint
#### NetBSD
You can build exiv2 from source using the methods described for linux. I built and installed exiv2 using "Pure CMake" and didn't require conan.
You will want to use the package manager `pkgsrc` to build/install the build and test components listed above.
I entered links into the file system
```
# ln -s /usr/pkg/bin/python37 /usr/local/bin/python3
# ln -s /usr/pkg/bin/bash /bin/bash`
```
It's important to ensure that `LD_LIBRARY_PATH` includes `/usr/local/lib` and `/usr/pkg/lib`.
It's important to ensure that `PATH` includes `/usr/local/bin`, `/usr/pkg/bin` and `/usr/pkg/sbin`.
#### FreeBSD
Clang is pre-installed as ``/usr/bin/{cc|c++}` as well as libz and expat. FreeBSD uses pkg as the package manager which I used to install cmake and git.
```bash
$ su root
Password:
# pkg install cmake
# pkg install git
# pkg install bash
# pkg install python
```
**Caution**: _The package manager *pkg* is no longer working on FreeBSD 12.0. I will move to 12.1 for future work. Others have reported this issue on 12.1. Broken package manager is very bad news. There are other package managers (such as ports), however installing and getting it to work is formidable._
```
634 rmills@rmillsmm-freebsd:~/gnu/github/exiv2/0.27-maintenance/build $ sudo pkg install libxml2
Updating FreeBSD repository catalogue...
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100% 916 B 0.9kB/s 00:01
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100% 6 MiB 340.2kB/s 00:19
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
635 rmills@rmillsmm-freebsd:~/gnu/github/exiv2/0.27-maintenance/build $
```
#### Solaris
Solaris uses the package manager pkg. To get a list of packages:
```bash
$ pkg list
```
To install a package:
```bash
$ sudo pkg install developer/gcc-7
```
[TOC](#TOC)
Written by Robin Mills
robin@clanmills.com
Updated: 2020-11-20