Repository: conan-io/conan-center-index

Issue:
[package] m4/1.4.19: Windows x86 build was broken
### Description

We use a copy of a conan-center-index and recently updated it from pre-v2 state to the most recent and m4 stopped building for Windows x86.

Maybe the problem is in host and build parameters which are passed to the configure script: `--host=i686-unknown-windows --build=x86_64-unknown-windows`. Because some time ago none were passed and then configure script guessed it as `i686-w64-mingw32`

<details><summary>Old log</summary>

```
m4/1.4.19: Calling:
 > /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/source_subfolder/configure gl_cv_func_printf_directive_n=no gl_cv_func_snprintf_directive_n=no gl_cv_func_snprintf_directive_n=no --prefix=C:/conan_tmp/.conan/data/m4/1.4.19/_/_/package/63c5d5dc6eb958dab897e143053e17f583d55879 
m4/1.4.19: run_in_windows_bash: C:\conan_tmp\c667cd\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879\^" ^&^& PATH=\^"/c/conan_tmp/c667cd/1/bin/msys64/usr/bin:/c/conan_tmp/c667cd/1/bin:$PATH\^" ^&^& /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/source_subfolder/configure gl_cv_func_printf_directive_n=no gl_cv_func_snprintf_directive_n=no gl_cv_func_snprintf_directive_n=no --prefix=C:/conan_tmp/.conan/data/m4/1.4.19/_/_/package/63c5d5dc6eb958dab897e143053e17f583d55879  ^"

----Running------
> C:\conan_tmp\c667cd\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879\^" ^&^& PATH=\^"/c/conan_tmp/c667cd/1/bin/msys64/usr/bin:/c/conan_tmp/c667cd/1/bin:$PATH\^" ^&^& /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/source_subfolder/configure gl_cv_func_printf_directive_n=no gl_cv_func_snprintf_directive_n=no gl_cv_func_snprintf_directive_n=no --prefix=C:/conan_tmp/.conan/data/m4/1.4.19/_/_/package/63c5d5dc6eb958dab897e143053e17f583d55879  ^"
-----------------
configure: loading site script /etc/config.site
checking for ... 
checking build system type... i686-w64-mingw32
checking host system type... i686-w64-mingw32
```
</details>

### Package and Environment Details

* Package Name/Version: **m4/1.4.19**
* Operating System+version: **Windows 10**
* Compiler+version: **Visual Studio 2019 v16.11.23**
* Docker image: **custom**
* Conan version: **conan 1.59.0**
* Python version: **Python 3.9**


### Conan profile

Configuration (profile_host):
[settings]
arch=x86
build_type=Release
compiler=Visual Studio
compiler.cppstd=17
compiler.runtime=MD
compiler.version=16
os=Windows
[options]
[build_requires]
[env]

Configuration (profile_build):
[settings]
arch=x86_64
build_type=Release
compiler=Visual Studio
compiler.cppstd=17
compiler.runtime=MD
compiler.version=16
os=Windows
[options]
[build_requires]
[env]

### Steps to reproduce

`recipes\m4\all>conan create . 1.4.19@ --profile:host=windows-vs-16-std-17-release-x86 --profile:build=windows-vs-16-std-17-release-x86_64 --test-folder test_v1_package`

### Logs

<details><summary>Click to expand log</summary>

```
m4/1.4.19: Forced build from source
msys2/cci.latest: Not found in local cache, looking in remotes...
msys2/cci.latest: Trying with 'conan-credo'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
msys2/cci.latest: Downloaded recipe revision db4884d8c515f74fe218d96fcf8f1bbb
m4/1.4.19 (test package): Installing package
Requirements
    m4/1.4.19 from local cache - Cache
Packages
    m4/1.4.19:63c5d5dc6eb958dab897e143053e17f583d55879 - Build
Build requirements
    msys2/cci.latest from 'conan-credo' - Downloaded
Build requirements packages
    msys2/cci.latest:eee3fba89db6d777329de604625af8c30d46f080 - Download

Cross-build from 'Windows:x86_64' to 'Windows:x86'
Installing (downloading, building) binaries...
msys2/cci.latest: Retrieving package eee3fba89db6d777329de604625af8c30d46f080 from remote 'conan-credo' 
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
msys2/cci.latest: Package installed eee3fba89db6d777329de604625af8c30d46f080
msys2/cci.latest: Downloaded package revision 0d5fc52f4415d588c96139229ce7c62d
m4/1.4.19: Applying build-requirement: msys2/cci.latest
m4/1.4.19: Configuring sources in C:\conan_tmp\.conan\data\m4\1.4.19\_\_\source\src
m4/1.4.19: 
m4/1.4.19: Copying sources to build folder
m4/1.4.19: Building your package in C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879
m4/1.4.19: Generator txt created conanbuildinfo.txt
m4/1.4.19: Calling generate()
m4/1.4.19: Aggregating env generators
m4/1.4.19: Calling build()
m4/1.4.19: Calling:
 > "/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/configure" --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --host=i686-unknown-windows --build=x86_64-unknown-windows gl_cv_func_printf_directive_n=no gl_cv_func_snprintf_directive_n=no gl_cv_func_snprintf_directive_n=no ac_cv_func__set_invalid_parameter_handler=yes 

----Running------
> "C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\conanbuild.bat" && "C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\msys2_mode.bat" && C:\conan_tmp\c667cd\1\bin\msys64\usr\bin\bash.exe --login -c ^". \^"C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\conanbuild.sh\^" ^&^& \^"/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/configure\^" --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --host=i686-unknown-windows --build=x86_64-unknown-windows gl_cv_func_printf_directive_n=no gl_cv_func_snprintf_directive_n=no gl_cv_func_snprintf_directive_n=no ac_cv_func__set_invalid_parameter_handler=yes ^"
-----------------
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.23
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-unknown-windows-strip... :
checking for a race-free mkdir -p... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for i686-unknown-windows-gcc... cl -nologo
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... obj
checking whether the compiler supports GNU C... no
checking whether cl -nologo accepts -g... no
checking for cl -nologo option to enable C11 features... unsupported
checking for cl -nologo option to enable C99 features... unsupported
checking for cl -nologo option to enable C89 features... unsupported
checking whether cl -nologo understands -c and -o together... no
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking whether make supports the include directive... yes (GNU style)
checking dependency style of /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/build-aux/compile cl -nologo... msvc7
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... no
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... no
checking for wchar.h... yes
checking for minix/config.h... no
checking for pthread.h... no
checking for sys/param.h... no
checking for sys/socket.h... no
checking for dirent.h... no
checking for stdio_ext.h... no
checking for getopt.h... no
checking for sys/cdefs.h... no
checking for threads.h... no
checking for iconv.h... no
checking for limits.h... yes
checking for crtdefs.h... yes
checking for wctype.h... yes
checking for langinfo.h... no
checking for xlocale.h... no
checking for math.h... yes
checking for sys/mman.h... no
checking for malloc.h... yes
checking for spawn.h... no
checking for sys/time.h... no
checking for sys/random.h... no
checking for sys/wait.h... no
checking for features.h... no
checking for arpa/inet.h... no
checking for semaphore.h... no
checking for netdb.h... no
checking for netinet/in.h... no
checking for sys/select.h... no
checking for sys/ioctl.h... no
checking for sys/uio.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking build system type... x86_64-unknown-windows
checking host system type... i686-unknown-windows
checking how to run the C preprocessor... /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/build-aux/compile cl -nologo -E
checking for grep that handles long lines and -e... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/grep
checking for egrep... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for i686-unknown-windows-ar... /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/build-aux/ar-lib lib
checking whether to use C++... no
checking for _LARGEFILE_SOURCE value needed for large files... unknown
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
configure: autobuild project... GNU M4
configure: autobuild revision... 1.4.19
configure: autobuild hostname... 2ce5d7037e79
configure: autobuild timestamp... 20230625T132216Z
checking for unsigned long long int... yes
checking for long long int... yes
checking for unsigned long long int... (cached) yes
checking for size_t... yes
checking for working alloca.h... no
checking for alloca... yes
checking for inline... inline
checking whether <wchar.h> uses 'inline' correctly... yes
checking for btowc... yes
checking for canonicalize_file_name... no
checking for faccessat... no
checking for realpath... no
checking for lstat... no
checking for _set_invalid_parameter_handler... (cached) yes
checking for fchdir... no
checking for fcntl... no
checking for symlink... no
checking for fdopendir... no
checking for mempcpy... no
checking for fpurge... no
checking for __fpurge... no
checking for __freadahead... no
checking for __freading... no
checking for fstatat... no
checking for getdtablesize... no
checking for getprogname... no
checking for getexecname... no
checking for getrandom... no
checking for iswcntrl... yes
checking for iswblank... yes
checking for uselocale... no
checking for newlocale... no
checking for duplocale... no
checking for freelocale... no
checking for mbsinit... no
checking for mbrtowc... yes
checking for mbslen... no
checking for mprotect... no
checking for mkstemp... no
checking for nl_langinfo... no
checking for openat... no
checking for pipe... no
checking for pipe2... no
checking for posix_spawn_file_actions_addchdir_np... no
checking for posix_spawn_file_actions_addchdir... no
checking for readlink... no
checking for isblank... yes
checking for iswctype... yes
checking for link... no
checking for secure_getenv... no
checking for getuid... no
checking for geteuid... no
checking for getgid... no
checking for getegid... no
checking for sigaction... no
checking for sigaltstack... no
checking for siginterrupt... no
checking for setrlimit... no
checking for getrlimit... no
checking for snprintf... no
checking for strerror_r... no
checking for __xpg_strerror_r... no
checking for strndup... no
checking for vasnprintf... no
checking for wcrtomb... yes
checking for wcwidth... no
checking for explicit_bzero... no
checking for memset_s... no
checking for ftruncate... no
checking for gettimeofday... no
checking for pthread_sigmask... no
checking for setenv... no
checking for sleep... no
checking for catgets... no
checking for shutdown... no
checking for mquery... no
checking for pstat_getprocvm... no
checking for wctob... yes
checking for nl_langinfo and CODESET... no
checking for a traditional french locale... fr_FR
checking whether malloc is ptrdiff_t safe... no
checking whether malloc, realloc, calloc set errno on failure... yes
checking whether lstat correctly handles trailing slash... guessing no
checking whether // is distinct from /... unknown, assuming no
checking whether realpath works... guessing no
checking for getcwd... yes
checking whether the preprocessor supports include_next... no
checking whether source code line length is unlimited... yes
checking absolute name of <dirent.h>... <dirent.h>
checking for /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/build-aux/compile cl -nologo options needed to detect all undeclared functions... none needed
checking if environ is properly declared... yes
checking for complete errno.h... no
checking absolute name of <errno.h>... ""
checking for EMULTIHOP value... no
checking for ENOLINK value... yes
checking for EOVERFLOW value... yes
checking whether strerror_r is declared... no
checking whether strerror_r returns char *... no
checking for mode_t... no
checking for sig_atomic_t... yes
checking whether fchdir is declared... no
checking for working fcntl.h... cross-compiling
checking for pid_t... no
checking absolute name of <fcntl.h>... ""
checking for eaccess... no
checking whether frexp() can be used without linking with libm... yes
checking whether alarm is declared... no
checking whether long double and double are the same... yes
checking whether stdin defaults to large file offsets... yes
checking absolute name of <sys/types.h>... ""
checking whether fseeko is declared... no
checking for fseeko... no
checking whether stat file-mode macros are broken... no
checking for C/C++ restrict keyword... no
checking absolute name of <sys/stat.h>... ""
checking for nlink_t... no
checking whether ftello is declared... no
checking whether ungetc works on arbitrary bytes... guessing no
checking for ftello... no
checking whether getcwd (NULL, 0) allocates memory for result... guessing no
checking for getcwd with POSIX signature... no
checking whether getcwd is declared... no
checking whether getdtablesize is declared... no
checking absolute name of <getopt.h>... <getopt.h>
checking for getopt.h... (cached) no
checking for pthread.h... (cached) no
checking whether POSIX threads API is available... no
checking for sched_yield in -lrt... no
checking for sched_yield in -lposix4... no
checking whether setlocale (LC_ALL, NULL) is multithread-safe... guessing no
checking whether setlocale (category, NULL) is multithread-safe... guessing no
checking host CPU and C ABI... i386
checking for ld... link
checking if the linker (link) is GNU ld... no
checking for shared library run path origin... done
checking 32-bit host C ABI... yes
checking for ELF binary format... no
checking for the common suffixes of directories in the library search path... lib,lib,lib
checking for iconv... no, consider installing GNU libiconv
checking absolute name of <iconv.h>... <iconv.h>
checking absolute name of <limits.h>... ""
checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... no
checking for wint_t... yes
checking whether wint_t is large enough... no
checking whether the compiler produces multi-arch binaries... no
checking absolute name of <stdint.h>... ""
checking whether stdint.h conforms to C99... guessing yes
checking whether stdint.h works without ISO C predefines... yes
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking absolute name of <inttypes.h>... ""
checking where to find the exponent in a 'double'... word 1 bit 20
checking where to find the exponent in a 'float'... word 0 bit 23
checking whether byte ordering is bigendian... (cached) no
checking absolute name of <wctype.h>... ""
checking whether iswcntrl works... guessing yes
checking for wctype_t... yes
checking for wctrans_t... yes
checking for a traditional japanese locale... none
checking for a french Unicode locale... fr_FR.UTF-8
checking for a transitional chinese locale... none
checking absolute name of <langinfo.h>... <langinfo.h>
checking for wchar_t... yes
checking for good max_align_t... no
checking whether NULL can be used in arbitrary expressions... yes
checking absolute name of <stddef.h>... ""
checking whether locale.h defines locale_t... no
checking whether locale.h conforms to POSIX:2001... no
checking whether struct lconv is properly defined... no
checking absolute name of <locale.h>... ""
checking for LC_MESSAGES... no
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyPreferredLanguages... no
checking for multithread API to use... none
checking for a sed that does not truncate output... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/sed
checking whether malloc (0) returns nonnull... guessing no
checking absolute name of <math.h>... ""
checking whether NAN macro works... yes
checking whether HUGE_VAL works... yes
checking for mbstate_t... yes
checking for mmap... no
checking whether memchr works... guessing no
checking whether memrchr is declared... no
checking whether <limits.h> defines MIN and MAX... no
checking whether <sys/param.h> defines MIN and MAX... no
checking for O_CLOEXEC... no
checking for promoted mode_t type... mode_t
checking for library containing posix_spawn... no
checking for posix_spawn... no
checking whether posix_spawn is declared... no
checking for sigset_t... no
checking for SIGPIPE... no
checking for sched.h... no
checking absolute name of <sched.h>... ""
checking for uid_t in sys/types.h... no
checking absolute name of <signal.h>... ""
checking for volatile sig_atomic_t... yes
checking for sighandler_t... no
checking whether C symbols are prefixed with underscore at the linker level... yes
checking whether snprintf returns a byte count as in C99... guessing no
checking whether snprintf is declared... yes
checking absolute name of <spawn.h>... <spawn.h>
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking whether fcloseall is declared... yes
checking absolute name of <stdio.h>... ""
checking which flavor of printf attribute matches inttypes macros... system
checking whether ecvt is declared... yes
checking whether fcvt is declared... yes
checking whether gcvt is declared... yes
checking absolute name of <stdlib.h>... ""
checking whether strdup is declared... yes
checking whether strerror(0) succeeds... guessing no
checking absolute name of <string.h>... ""
checking whether strndup is declared... no
checking whether strnlen is declared... yes
checking whether strsignal is declared... no
checking whether ldexp() can be used without linking with libm... yes
checking absolute name of <sys/random.h>... <sys/random.h>
checking absolute name of <sys/wait.h>... <sys/wait.h>
checking for struct timespec in <time.h>... yes
checking absolute name of <time.h>... ""
checking for TIME_UTC in <time.h>... yes
checking whether execvpe is declared... no
checking absolute name of <unistd.h>... <unistd.h>
checking whether clearerr_unlocked is declared... no
checking whether feof_unlocked is declared... no
checking whether ferror_unlocked is declared... no
checking whether fflush_unlocked is declared... no
checking whether fgets_unlocked is declared... no
checking whether fputc_unlocked is declared... no
checking whether fputs_unlocked is declared... no
checking whether fread_unlocked is declared... no
checking whether fwrite_unlocked is declared... no
checking whether getc_unlocked is declared... no
checking whether getchar_unlocked is declared... no
checking whether putc_unlocked is declared... no
checking whether putchar_unlocked is declared... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking whether snprintf truncates the result as in C99... guessing no
checking for snprintf... (cached) no
checking for strnlen... yes
checking for wcslen... no
checking for wcsnlen... yes
checking for mbrtowc... (cached) yes
checking for wcrtomb... (cached) yes
checking whether _snprintf is declared... yes
checking whether printf supports size specifiers as in C99... guessing no
checking whether printf supports 'long double' arguments... guessing yes
checking whether printf supports infinite 'double' arguments... guessing no
checking whether printf supports infinite 'long double' arguments... guessing no
checking whether printf supports the 'a' and 'A' directives... guessing no
checking whether printf supports the 'F' directive... guessing no
checking whether printf supports the 'n' directive... (cached) no
checking whether printf supports the 'ls' directive... guessing yes
checking whether printf supports the grouping flag... guessing yes
checking whether printf supports the left-adjust flag correctly... guessing yes
checking whether printf supports the zero flag correctly... guessing no
checking whether printf supports large precisions... guessing yes
checking whether printf survives out-of-memory conditions... guessing no
checking absolute name of <wchar.h>... ""
checking whether wcsdup is declared... yes
checking for ws2tcpip.h... yes
checking whether <sys/socket.h> is self-contained... no
checking absolute name of <sys/socket.h>... <sys/socket.h>
checking for struct sockaddr_storage... yes
checking for sa_family_t... no
checking for struct sockaddr_storage.ss_family... yes
checking for winsock2.h... yes
checking absolute name of <arpa/inet.h>... <arpa/inet.h>
checking for library needed for semaphore functions... none
checking absolute name of <ctype.h>... ""
checking absolute name of <sys/time.h>... <sys/time.h>
checking for winsock2.h... (cached) yes
checking for struct timeval... yes
checking for wide-enough struct timeval.tv_sec member... no
checking for IPv4 sockets... yes
checking for IPv6 sockets... yes
checking for off_t... yes
checking whether INT32_MAX < INTMAX_MAX... yes
checking whether INT64_MAX == LONG_MAX... no
checking whether UINT32_MAX < UINTMAX_MAX... yes
checking whether UINT64_MAX == ULONG_MAX... no
checking whether <sys/select.h> is self-contained... no
checking absolute name of <sys/select.h>... <sys/select.h>
checking for winsock2.h... (cached) yes
checking for winsock2.h... (cached) yes
checking for WSAStartup... yes
checking absolute name of <pthread.h>... <pthread.h>
checking for pthread_t... no
checking for pthread_spinlock_t... no
checking for PTHREAD_CREATE_DETACHED... no
checking for PTHREAD_MUTEX_RECURSIVE... no
checking for PTHREAD_MUTEX_ROBUST... no
checking for PTHREAD_PROCESS_SHARED... no
checking whether setenv is declared... no
checking for search.h... yes
checking for tsearch... no
checking absolute name of <sys/ioctl.h>... <sys/ioctl.h>
checking absolute name of <sys/uio.h>... <sys/uio.h>
checking whether unsetenv is declared... no
checking whether to enable assertions... yes
checking whether btowc(0) is correct... guessing yes
checking whether btowc(EOF) is correct... guessing yes
checking for __builtin_expect... no
checking whether this system supports file names of any length... no
checking for library containing clock_gettime... no
checking for clock_gettime... no
checking for clock_settime... no
checking for winsock2.h... (cached) yes
checking for closedir... no
checking for d_ino member in directory struct... guessing no
checking for dirfd... no
checking whether dirfd is declared... no
checking whether dirfd is a macro... no
checking how to get the file descriptor associated with an open DIR*... no_such_member
checking whether // is distinct from /... (cached) unknown, assuming no
checking whether dup works... guessing yes
checking whether dup2 works... guessing yes
checking for error_at_line... no
checking whether open can visit directories... guessing no
checking whether fflush works on input streams... cross
checking whether fdopendir is declared... no
checking whether fflush works on input streams... (cached) cross
checking for flexible array member... yes
checking whether conversion from 'int' to 'long double' works... guessing yes
checking whether fopen recognizes a trailing slash... guessing yes
checking whether fopen supports the mode character 'x'... guessing no
checking whether fopen supports the mode character 'e'... guessing no
checking for __fpending... no
checking whether fpurge is declared... no
checking whether free is known to preserve errno... no
checking whether frexp works... guessing yes
checking whether frexpl is declared... yes
checking whether frexpl() can be used without linking with libm... yes
checking whether frexpl works... guessing yes
checking for fseeko... (cached) no
checking for _fseeki64... yes
checking whether _fseeki64 is declared... yes
checking for ftello... (cached) no
checking for _ftelli64... yes
checking whether getcwd handles long file names properly... guessing no
checking for getpagesize... no
checking for OS.h... no
checking for sys/param.h... (cached) no
checking whether getpagesize is declared... no
checking whether program_invocation_name is declared... no
checking whether program_invocation_short_name is declared... no
checking whether __argv is declared... yes
checking whether the compiler generally respects inline... yes
checking whether isnan(double) can be used without linking with libm... yes
checking whether isnan(float) can be used without linking with libm... yes
checking whether isnan(float) works... guessing yes
checking whether isnan(long double) can be used without linking with libm... yes
checking whether isnanl works... guessing yes
checking whether iswblank is declared... yes
checking whether the compiler supports the __inline keyword... yes
checking for struct lconv.decimal_point... yes
checking whether lseek detects pipes... yes
checking whether imported symbols can be declared weak... no
checking whether mbsinit is declared... yes
checking for mbtowc... yes
checking for bp-sym.h... no
checking for mempcpy... (cached) no
checking for memrchr... no
checking whether mkdir handles trailing slash... guessing no
checking whether mkdir handles trailing dot... guessing no
checking for mkdtemp... no
checking for obstacks that work with any size object... no
checking whether open recognizes a trailing slash... guessing yes
checking for opendir... no
checking for paths.h... no
checking for confstr... no
checking for sched_setparam... no
checking for sched_setscheduler... no
checking for setegid... no
checking for seteuid... no
checking for vfork... no
checking whether posix_spawn_file_actions_addclose works... guessing yes
checking whether posix_spawn_file_actions_adddup2 works... guessing yes
checking whether posix_spawn_file_actions_addopen works... guessing yes
checking whether frexp works... (cached) guessing yes
checking whether ldexp can be used without linking with libm... (cached) yes
checking whether frexpl() can be used without linking with libm... (cached) yes
checking whether frexpl works... (cached) guessing yes
checking whether frexpl is declared... (cached) yes
checking whether ldexpl() can be used without linking with libm... yes
checking whether ldexpl works... guessing yes
checking whether ldexpl is declared... yes
checking whether program_invocation_name is declared... (cached) no
checking whether program_invocation_short_name is declared... (cached) no
checking for raise... yes
checking for rawmemchr... no
checking for readdir... no
checking for reallocarray... no
checking for working re_compile_pattern... guessing no
checking for libintl.h... no
checking whether isblank is declared... yes
checking whether rename honors trailing slash on destination... guessing no
checking whether rename honors trailing slash on source... guessing no
checking whether rename manages hard links correctly... yes
checking whether rename manages existing destinations correctly... guessing no
checking for rewinddir... no
checking whether rmdir works... guessing no
checking for __secure_getenv... no
checking for issetugid... no
checking whether setlocale supports the C locale... guessing yes
checking whether setlocale (LC_ALL, NULL) is multithread-safe... (cached) trivially yes
checking whether setlocale (category, NULL) is multithread-safe... (cached) trivially yes
checking for siginfo_t... no
checking for signbit macro... guessing no
checking for signbit compiler built-ins... guessing no
checking where to find the sign bit in a 'float'... unknown
checking where to find the sign bit in a 'double'... unknown
checking where to find the sign bit in a 'long double'... unknown
checking whether copysignf is declared... yes
checking whether copysignf can be used without linking with libm... yes
checking whether copysign is declared... yes
checking whether copysign can be used without linking with libm... yes
checking whether copysignl is declared... yes
checking whether copysignl can be used without linking with libm... yes
checking for stack direction... grows down
checking for working sigaltstack... no
checking for stdint.h... (cached) yes
checking for SIZE_MAX... yes
checking for snprintf... (cached) no
checking for ssize_t... no
checking whether stat handles trailing slashes on files... guessing no
checking for struct stat.st_atim.tv_nsec... no
checking for struct stat.st_atimespec.tv_nsec... no
checking for struct stat.st_atimensec... no
checking for struct stat.st_atim.st__tim.tv_nsec... no
checking for struct stat.st_birthtimespec.tv_nsec... no
checking for struct stat.st_birthtimensec... no
checking for struct stat.st_birthtim.tv_nsec... no
checking for working stdalign.h... no
checking for va_copy... yes
checking for stpcpy... no
checking for strchrnul... no
checking for winsock2.h... (cached) yes
checking for working strnlen... yes
checking for strsignal... no
checking whether sys_siglist is declared... no
checking whether _sys_siglist is declared... no
checking whether strtod obeys C99... guessing no
checking for nl_langinfo... (cached) no
checking for sys/single_threaded.h... no
checking for ptrdiff_t... yes
checking for vasprintf... no
checking for vasprintf... (cached) no
checking for nl_langinfo... (cached) no
checking for ptrdiff_t... (cached) yes
checking for waitid... no
checking whether wcrtomb works in the C locale... guessing yes
checking whether wcrtomb return value is correct... guessing yes
checking whether wcwidth is declared... no
checking whether wcwidth is a macro... no
checking for stdint.h... (cached) yes
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional french locale... (cached) fr_FR
checking for a turkish Unicode locale... none
checking whether open recognizes a trailing slash... (cached) guessing yes
checking for close_range... no
checking for explicit_memset... no
checking whether freopen works on closed fds... guessing yes
checking for _chsize... yes
checking for winsock2.h... (cached) yes
checking whether inet_pton is declared... yes
checking whether byte ordering is bigendian... (cached) no
checking where to find the exponent in a 'double'... (cached) word 1 bit 20
checking where to find the exponent in a 'float'... (cached) word 0 bit 23
checking where to find the exponent in a 'long double'... unknown
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a transitional chinese locale... (cached) none
checking for library containing nanosleep... no
checking whether <netinet/in.h> is self-contained... no
checking for netinet/in.h... (cached) no
checking absolute name of <netinet/in.h>... <netinet/in.h>
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking whether perror matches strerror... guessing no
checking whether pthread_sigmask is a macro... no
checking for putenv compatible with GNU and SVID... guessing no
checking whether _putenv is declared... yes
checking whether sched_yield is declared... no
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking whether sleep is declared... no
checking for socklen_t... yes
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for unsetenv... no
checking for a traditional french locale... (cached) fr_FR
checking for a french Unicode locale... (cached) fr_FR.UTF-8
checking for a traditional japanese locale... (cached) none
checking for a transitional chinese locale... (cached) none
checking whether wctob works... guessing yes
checking whether wctob is declared... yes
checking whether an open file can be renamed... guessing no
checking if changeword is wanted... no
checking which shell to use for syscmd... /bin/sh
checking if malloc debugging is wanted... no
checking whether NLS is requested... yes
checking for msgfmt... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/msgfmt
checking for gmsgfmt... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/msgfmt
checking for xgettext... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/xgettext
checking for msgmerge... /c/conan_tmp/c667cd/1/bin/msys64/usr/bin/msgmerge
checking for CFPreferencesCopyAppValue... (cached) no
checking for CFLocaleCopyPreferredLanguages... (cached) no
checking for GNU gettext in libc... no
checking for iconv... (cached) no, consider installing GNU libiconv
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating lib/Makefile
config.status: creating po/Makefile.in
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating checks/Makefile
config.status: creating examples/Makefile
config.status: creating lib/config.h
config.status: linking /c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/src/GNUmakefile to GNUmakefile
config.status: executing depfiles commands
config.status: executing stamp-h commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile

----Running------
> "C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\conanbuild.bat" && "C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\msys2_mode.bat" && C:\conan_tmp\c667cd\1\bin\msys64\usr\bin\bash.exe --login -c ^". \^"C:\conan_tmp\.conan\data\m4\1.4.19\_\_\build\63c5d5dc6eb958dab897e143053e17f583d55879\build-release\conan\conanbuild.sh\^" ^&^& make -j12^"
-----------------
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.23
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'
make  all-recursive
make[1]: Entering directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release'
Making all in .
make[2]: Entering directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release'
Making all in examples
make[2]: Entering directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release/examples'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release/examples'
Making all in lib
make[2]: Entering directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release/lib'
  GEN      alloca.h
  GEN      configmake.h
  GEN      dirent.h
  GEN      errno.h
  GEN      fcntl.h
  GEN      getopt.h
  GEN      getopt-cdefs.h
  GEN      inttypes.h
  GEN      langinfo.h
  GEN      limits.h
  GEN      locale.h
  GEN      math.h
  GEN      sched.h
  GEN      signal.h
  GEN      sigsegv.h
  GEN      spawn.h
  GEN      stdalign.h
  GEN      stddef.h
  GEN      stdint.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
  GEN      sys/random.h
  GEN      sys/stat.h
  GEN      sys/types.h
  GEN      sys/wait.h
  GEN      time.h
  GEN      unistd.h
  GEN      unistr.h
  GEN      unitypes.h
  GEN      uniwidth.h
  GEN      wchar.h
  GEN      wctype.h
make  all-am
make[3]: Entering directory '/c/conan_tmp/.conan/data/m4/1.4.19/_/_/build/63c5d5dc6eb958dab897e143053e17f583d55879/build-release/lib'
  CC       asyncsafe-spin.obj
  CC       openat-proc.obj
  CC       gl_avltree_oset.obj
  CC       basename-lgpl.obj
  CC       binary-io.obj
  CC       bitrotate.obj
  CC       c-ctype.obj
  CC       c-stack.obj
  CC       c-strcasecmp.obj
  CC       c-strncasecmp.obj
  CC       canonicalize.obj
  CC       clean-temp.obj
basename-lgpl.c
.\stddef.h(79): fatal error C1083: Cannot open include file: '': No such file or directory
c-strcasecmp.c
.\stddef.h(79): fatal error C1083: Cannot open include file: '': No such file or directory
openat-proc.c
.\errno.h(27): fatal error C1083: Cannot open include file: '': No such file or directory
binary-io.c
.\sys/types.h(39): fatal error C1083: Cannot open include file: '': No such file or directory
asyncsafe-spin.c
.\sys/types.h(39): fatal error C1083: Cannot open include file: '': No such file or directory
bitrotate.c
.\limits.h(41): fatal error C1083: Cannot open include file: '': No such file or directory
c-stack.c
.\errno.h(27): fatal error C1083: Cannot open include file: '': No such file or directory
gl_avltree_oset.c
.\stddef.h(79): fatal error C1083: Cannot open include file: '': No such file or directory
canonicalize.c
.\stdlib.h(36): fatal error C1083: Cannot open include file: '': No such file or directory
c-ctype.c
clean-temp.c
.\stdio.h(43): fatal error C1083: Cannot open include file: '': No such file or directory
c-strncasecmp.c
.\stddef.h(79): fatal error C1083: Cannot open include file: '': No such file or directory
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py
--- a/recipes/m4/all/conanfile.py
+++ b/recipes/m4/all/conanfile.py
@@ -1,4 +1,5 @@
 from conan import ConanFile
+from conan.tools.build import cross_building
 from conan.tools.env import VirtualBuildEnv
 from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save
 from conan.tools.gnu import Autotools, AutotoolsToolchain
@@ -67,6 +68,19 @@ def generate(self):
                 "-rtlib=compiler-rt",
                 "-Wno-unused-command-line-argument",
             ])
+        if cross_building(self) and is_msvc(self):
+            triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"}
+            
+            host_arch = triplet_arch_windows.get(str(self.settings.arch))
+            build_arch = triplet_arch_windows.get(str(self._settings_build.arch))
+
+            if host_arch and build_arch:
+                host = f"{host_arch}-w64-mingw32"
+                build = f"{build_arch}-w64-mingw32"
+                tc.configure_args.extend([
+                    f"--host={host}",
+                    f"--build={build}",
+                ])
         if self.settings.os == "Windows":
             tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes")
         env = tc.environment()


Test patch:
diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py
--- a/recipes/m4/all/test_package/conanfile.py
+++ b/recipes/m4/all/test_package/conanfile.py
@@ -26,11 +26,12 @@ def build(self):
         """))
 
     def test(self):
-        self.run("m4 --version")
-        self.run(f"m4 -P {self._m4_input_path}")
+        extension = ".exe" if self.settings.os == "Windows" else ""
+        self.run(f"m4{extension} --version")
+        self.run(f"m4{extension} -P {self._m4_input_path}")
 
-        self.run(f"m4 -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4")
+        self.run(f"m4{extension} -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4")
 
         output = StringIO()
-        self.run(f"m4 -P {self._m4_input_path}", output)
+        self.run(f"m4{extension} -P {self._m4_input_path}", output)
         assert "Harry, Jr. met Sally" in output.getvalue()
diff --git a/recipes/m4/all/test_v1_package/conanfile.py b/recipes/m4/all/test_v1_package/conanfile.py
--- a/recipes/m4/all/test_v1_package/conanfile.py
+++ b/recipes/m4/all/test_v1_package/conanfile.py
@@ -30,12 +30,13 @@ def test(self):
                 raise ConanException("M4 environment variable not set")
 
         if not tools.cross_building(self, skip_x64_x86=True):
-            self.run("{} --version".format(m4_bin), run_environment=True)
-            self.run("{} -P {}".format(m4_bin, self._m4_input_path))
+            self.run(f"{m4_bin} --version", run_environment=True)
+            self.run(f"{m4_bin} -P {self._m4_input_path}")
 
-            self.run("m4 -R {0}/frozen.m4f {0}/test.m4".format(os.path.join(self.source_folder, os.pardir, "test_package"), run_environment=True))
+            test_package_dir = os.path.join(self.source_folder, os.pardir, "test_package")
+            self.run(f"{m4_bin} -R {test_package_dir}/frozen.m4f {test_package_dir}/test.m4", run_environment=True)
 
             output = StringIO()
-            self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output)
+            self.run(f"{m4_bin} -P {self._m4_input_path}", output=output)
 
             assert "Harry, Jr. met Sally" in output.getvalue()