I use this batch file to start the MinGW bash shell from the Dos Command Prompt (cmd.exe)
```
$ for i in libtre git coreutils mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-cmake; do (echo y|pacman -S $i); done
$ cat msys32.bat
setlocal
set "PATH=c:\msys32\usr\bin;c:\msys32\usr\local\bin;c:\msys32\mingw64\bin;"
set "PS1=\! \u@\h-32:\w \$ "
bash.exe -norc
$
```
#### Download exiv2 from github and build.
#### Install MinGW Dependencies
```
for i in base-devel git cmake coreutils python3 man gcc gdb make dos2unix diffutils zlib-devel libexpat-devel libiconv-devel; do (echo y|pacman -S $i); done
```
#### Download exiv2 from github and build
```
$ mkdir -p ~/gnu/github/exiv2
@ -329,6 +341,11 @@ $ mkdir build ; cd build ;
$ cmake .. -G "Unix Makefiles"
$ make
```
#### MinGW and Regex
The exiv2 command line program provides a `--grep` option which filters output. The implementation requires the header file `<regex.h>` and supporting library to be available during the build. When not available, the option degenerates to a substring match. Because there are multiple versions of `<regex.h>` available on the MinGW platform, detection of Regex is always disabled on this platform.