Repository: conan-io/conan-center-index

Issue:
[package] <automake>/<1.16.2>: configure step fails because m4 is required
When m4 is not installed on your system creating the automake/1.16.2 (and 1.16.1) package will fail, see logs below.

When I add m4/1.4.18 as a requirement to the automake conan recipe, the error disappears.
I will create a pull request.

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **automake/1.16.2**
  * Operating System+version: **Linux OpenSuse 15.1 + Linux Ubuntu 18.04**
  * Compiler+version: **GCC 7.5**
  * Conan version: **conan 1.26.1**
  * Python version: **Python 3.6.9**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
cppstd=17
[options]
[build_requires]
*: ninja/1.10.0, cmake/3.17.3
```


### Steps to reproduce (Include if Applicable)
On a Linux system where m4 is not installed by your native package manager execute command:
`conan create ~/git/conan-center-index/recipes/automake/all/ automake/1.16.1@`


### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
winfried@coop2:~$ conan create ~/git/conan-center-index/recipes/automake/all/ automake/1.16.1@
<cut>
checking whether autoconf works... no
configure: error: The installed version of autoconf does not work.
    Please check config.log for error messages before this one.
automake/1.16.1: 
automake/1.16.1: ERROR: Package 'e9965c1d3c0a49190fb04d7eb6668cf12ca4cc23' build failed
automake/1.16.1: WARN: Build folder /home/winfried/.conan/data/automake/1.16.1/_/_/build/e9965c1d3c0a49190fb04d7eb6668cf12ca4cc23
ERROR: automake/1.16.1: Error in build() method, line 65
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 56
        self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder)
        ConanException: Error 1 while executing /home/winfried/.conan/data/automake/1.16.1/_/_/build/e9965c1d3c0a49190fb04d7eb6668cf12ca4cc23/source_subfolder/configure '--datarootdir=/home/winfried/.conan/data/automake/1.16.1/_/_/package/e9965c1d3c0a49190fb04d7eb6668cf12ca4cc23/bin/share' '--prefix=/home/winfried/.conan/data/automake/1.16.1/_/_/package/e9965c1d3c0a49190fb04d7eb6668cf12ca4cc23' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include'

The config.log file says:

configure:2952: checking whether autoconf works
configure:2959: cd conftest && /home/winfried/.conan/data/autoconf/2.69/_/_/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/bin/autoconf -o /dev/null conftest.ac
autom4te: need GNU m4 1.4 or later: /usr/bin/env m4
configure:2962: $? = 1
configure:2971: result: no
configure:2974: error: The installed version of autoconf does not work.
    Please check config.log for error messages before this one.
```
</details>



Discussion:

Resolving patch:
diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py
--- a/recipes/autoconf/all/conanfile.py
+++ b/recipes/autoconf/all/conanfile.py
@@ -21,6 +21,11 @@ def source(self):
         tools.get(**self.conan_data["sources"][self.version])
         os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
 
+    def requirements(self):
+        if self.settings.os_build != "Windows":
+            #the Conan m4 package currently doesn't work correctly with autoconf on Windows
+            self.requires("m4/1.4.18")
+
     def build_requirements(self):
         if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ:
             self.build_requires("msys2/20190524")


Test patch: