We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] m4/1.4.19: Runtime assertion windows pops up on MSVC in Debug mode

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **m4/1.4.19**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC 2017, 2019 in DEBUG**
  * Conan version: **conan 1.44.0**
  * Python version: **Python 3.9.5**

I have a recipe that depends on bison. 3.7.6 gives me parse errors, so I keep it at 3.7.1. I had pinned the exact bison/3.7.1 recipe and all worked well. I am trying to update my dependencies, so I tried the newest bison/3.7.1 revision, and I am now getting an assertion popup in m4.

I have tried various combinations to see if I could pinpoint what changed. My conclusion is that it's the move from m4/1.4.18 to m4/1.4.19 (I have tried the newest recipe revision of m4/1.4.18 and it worked, and the only m4/1.4.19 available fails).

```python
        # Latest bison/3.7.1 with m4/1.4.18
        #self.build_requires("bison/3.7.1#dcffa3dd9204cb79ac7ca09a7f19bb8b") #  Works

        # First bison/3.7.1 with m4/1.4.19
        self.build_requires("bison/3.7.1#47f49e709ddb9f8e055471c4e3c4e67d"): # Fails

        # Latest bison/3.7.1
        #self.build_requires("bison/3.7.1#ad29e804e82c8b6d58765096676b5a5e") # Fails
```

<img width="886" alt="Screen Shot 2022-01-14 at 13 35 01" src="https://user-images.githubusercontent.com/5479063/149528919-eff87be5-e7cc-4924-bb52-e67246e3cf1f.png">





### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)

```
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)

```
git clone git@github.com:NREL/conan-openstudio-ruby.git
git checkout update_ruby_installer_and_remotes

'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat' x64

conan create . openstudio_ruby/2.7.2@nrel/testing -b missing -b openstudio_ruby -s build_type=Debug
```

### Logs (Include/Attach if Applicable)

Example of a failed run: https://github.com/NREL/conan-openstudio-ruby/runs/4787415523?check_suite_focus=true


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/m4/all/conanfile.py`
Content:
```
1 from conans import ConanFile, tools, AutoToolsBuildEnvironment
2 from contextlib import contextmanager
3 import functools
4 import os
5 
6 required_conan_version = ">=1.33.0"
7 
8 
9 class M4Conan(ConanFile):
10     name = "m4"
11     description = "GNU M4 is an implementation of the traditional Unix macro processor"
12     topics = ("macro", "preprocessor")
13     homepage = "https://www.gnu.org/software/m4/"
14     url = "https://github.com/conan-io/conan-center-index"
15     license = "GPL-3.0-only"
16     settings = "os", "arch", "compiler", "build_type"
17 
18     exports_sources = "patches/*.patch",
19 
20     @property
21     def _source_subfolder(self):
22         return "source_subfolder"
23 
24     @property
25     def _settings_build(self):
26         return getattr(self, "settings_build", self.settings)
27 
28     @property
29     def _is_msvc(self):
30         return self.settings.compiler == "Visual Studio"
31 
32     def build_requirements(self):
33         if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"):
34             self.build_requires("msys2/cci.latest")
35 
36     def package_id(self):
37         del self.info.settings.compiler
38 
39     def source(self):
40         tools.get(**self.conan_data["sources"][self.version],
41                   destination=self._source_subfolder, strip_root=True)
42 
43     @functools.lru_cache(1)
44     def _configure_autotools(self):
45         conf_args = []
46         autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows")
47         build_canonical_name = None
48         host_canonical_name = None
49         if self.settings.compiler == "Visual Studio":
50             # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio
51             build_canonical_name = False
52             host_canonical_name = False
53             autotools.flags.append("-FS")
54             # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug
55             # Visual Studio does not support the %n format flag:
56             # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions
57             # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,
58             # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.
59             conf_args.extend(["gl_cv_func_printf_directive_n=no", "gl_cv_func_snprintf_directive_n=no", "gl_cv_func_snprintf_directive_n=no"])
60             if self.settings.build_type in ("Debug", "RelWithDebInfo"):
61                 autotools.link_flags.append("-PDB")
62         elif self.settings.compiler == "clang":
63             if tools.Version(self.version) < "1.4.19":
64                 autotools.flags.extend(["-rtlib=compiler-rt", "-Wno-unused-command-line-argument"])
65         autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name)
66         return autotools
67 
68     @contextmanager
69     def _build_context(self):
70         if self.settings.compiler == "Visual Studio":
71             with tools.vcvars(self.settings):
72                 env = {
73                     "AR": "{}/build-aux/ar-lib lib".format(tools.unix_path(self._source_subfolder)),
74                     "CC": "cl -nologo",
75                     "CXX": "cl -nologo",
76                     "LD": "link",
77                     "NM": "dumpbin -symbols",
78                     "OBJDUMP": ":",
79                     "RANLIB": ":",
80                     "STRIP": ":",
81                 }
82                 with tools.environment_append(env):
83                     yield
84         else:
85             yield
86 
87     def _patch_sources(self):
88         for patch in self.conan_data.get("patches", {}).get(self.version, []):
89             tools.patch(**patch)
90 
91     def build(self):
92         self._patch_sources()
93         with self._build_context():
94             autotools = self._configure_autotools()
95             autotools.make()
96             if tools.get_env("CONAN_RUN_TESTS", False):
97                 self.output.info("Running m4 checks...")
98                 with tools.chdir("tests"):
99                     autotools.make(target="check")
100 
101     def package(self):
102         self.copy("COPYING", src=self._source_subfolder, dst="licenses")
103         with self._build_context():
104             autotools = self._configure_autotools()
105             autotools.install()
106         tools.rmdir(os.path.join(self.package_folder, "share"))
107 
108     def package_info(self):
109         self.cpp_info.libdirs = []
110 
111         bin_path = os.path.join(self.package_folder, "bin")
112         self.output.info("Appending PATH environment variable: {}".format(bin_path))
113         self.env_info.PATH.append(bin_path)
114 
115         bin_ext = ".exe" if self.settings.os == "Windows" else ""
116         m4_bin = os.path.join(self.package_folder, "bin", "m4{}".format(bin_ext)).replace("\\", "/")
117 
118         # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path
119         self.output.info("Setting M4 environment variable: {}".format(m4_bin))
120         self.env_info.M4 = m4_bin
121
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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
@@ -27,7 +27,7 @@
 
     @property
     def _is_msvc(self):
-        return self.settings.compiler == "Visual Studio"
+        return self.settings.compiler == "Visual Studio" or self.settings.compiler == "msvc"
 
     def build_requirements(self):
         if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"):
@@ -46,7 +46,7 @@
         autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows")
         build_canonical_name = None
         host_canonical_name = None
-        if self.settings.compiler == "Visual Studio":
+        if self._is_msvc:
             # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio
             build_canonical_name = False
             host_canonical_name = False
@@ -62,14 +62,18 @@
         elif self.settings.compiler == "clang":
             if tools.Version(self.version) < "1.4.19":
                 autotools.flags.extend(["-rtlib=compiler-rt", "-Wno-unused-command-line-argument"])
+        if self.settings.os == 'Windows':
+            conf_args.extend(["ac_cv_func__set_invalid_parameter_handler=yes"])
+
         autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name)
         return autotools
 
     @contextmanager
     def _build_context(self):
-        if self.settings.compiler == "Visual Studio":
+        env = {"PATH": [os.path.abspath(self._source_subfolder)]}
+        if self._is_msvc:
             with tools.vcvars(self.settings):
-                env = {
+                env.update({
                     "AR": "{}/build-aux/ar-lib lib".format(tools.unix_path(self._source_subfolder)),
                     "CC": "cl -nologo",
                     "CXX": "cl -nologo",
@@ -78,17 +82,22 @@
                     "OBJDUMP": ":",
                     "RANLIB": ":",
                     "STRIP": ":",
-                }
+                })
                 with tools.environment_append(env):
                     yield
         else:
-            yield
+            with tools.environment_append(env):
+                yield
 
     def _patch_sources(self):
         for patch in self.conan_data.get("patches", {}).get(self.version, []):
             tools.patch(**patch)
 
     def build(self):
+        with tools.chdir(self._source_subfolder):
+            tools.save("help2man", '#!/usr/bin/env bash\n:')
+            if os.name == 'posix':
+                os.chmod("help2man", os.stat("help2man").st_mode | 0o111)
         self._patch_sources()
         with self._build_context():
             autotools = self._configure_autotools()

{"golden_diff": "diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py\n--- a/recipes/m4/all/conanfile.py\n+++ b/recipes/m4/all/conanfile.py\n@@ -27,7 +27,7 @@\n \n     @property\n     def _is_msvc(self):\n-        return self.settings.compiler == \"Visual Studio\"\n+        return self.settings.compiler == \"Visual Studio\" or self.settings.compiler == \"msvc\"\n \n     def build_requirements(self):\n         if self._settings_build.os == \"Windows\" and not tools.get_env(\"CONAN_BASH_PATH\"):\n@@ -46,7 +46,7 @@\n         autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == \"Windows\")\n         build_canonical_name = None\n         host_canonical_name = None\n-        if self.settings.compiler == \"Visual Studio\":\n+        if self._is_msvc:\n             # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio\n             build_canonical_name = False\n             host_canonical_name = False\n@@ -62,14 +62,18 @@\n         elif self.settings.compiler == \"clang\":\n             if tools.Version(self.version) < \"1.4.19\":\n                 autotools.flags.extend([\"-rtlib=compiler-rt\", \"-Wno-unused-command-line-argument\"])\n+        if self.settings.os == 'Windows':\n+            conf_args.extend([\"ac_cv_func__set_invalid_parameter_handler=yes\"])\n+\n         autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name)\n         return autotools\n \n     @contextmanager\n     def _build_context(self):\n-        if self.settings.compiler == \"Visual Studio\":\n+        env = {\"PATH\": [os.path.abspath(self._source_subfolder)]}\n+        if self._is_msvc:\n             with tools.vcvars(self.settings):\n-                env = {\n+                env.update({\n                     \"AR\": \"{}/build-aux/ar-lib lib\".format(tools.unix_path(self._source_subfolder)),\n                     \"CC\": \"cl -nologo\",\n                     \"CXX\": \"cl -nologo\",\n@@ -78,17 +82,22 @@\n                     \"OBJDUMP\": \":\",\n                     \"RANLIB\": \":\",\n                     \"STRIP\": \":\",\n-                }\n+                })\n                 with tools.environment_append(env):\n                     yield\n         else:\n-            yield\n+            with tools.environment_append(env):\n+                yield\n \n     def _patch_sources(self):\n         for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n             tools.patch(**patch)\n \n     def build(self):\n+        with tools.chdir(self._source_subfolder):\n+            tools.save(\"help2man\", '#!/usr/bin/env bash\\n:')\n+            if os.name == 'posix':\n+                os.chmod(\"help2man\", os.stat(\"help2man\").st_mode | 0o111)\n         self._patch_sources()\n         with self._build_context():\n             autotools = self._configure_autotools()\n", "issue": "[package] m4/1.4.19: Runtime assertion windows pops up on MSVC in Debug mode\n\r\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **m4/1.4.19**\r\n  * Operating System+version: **Windows 10**\r\n  * Compiler+version: **MSVC 2017, 2019 in DEBUG**\r\n  * Conan version: **conan 1.44.0**\r\n  * Python version: **Python 3.9.5**\r\n\r\nI have a recipe that depends on bison. 3.7.6 gives me parse errors, so I keep it at 3.7.1. I had pinned the exact bison/3.7.1 recipe and all worked well. I am trying to update my dependencies, so I tried the newest bison/3.7.1 revision, and I am now getting an assertion popup in m4.\r\n\r\nI have tried various combinations to see if I could pinpoint what changed. My conclusion is that it's the move from m4/1.4.18 to m4/1.4.19 (I have tried the newest recipe revision of m4/1.4.18 and it worked, and the only m4/1.4.19 available fails).\r\n\r\n```python\r\n        # Latest bison/3.7.1 with m4/1.4.18\r\n        #self.build_requires(\"bison/3.7.1#dcffa3dd9204cb79ac7ca09a7f19bb8b\") #  Works\r\n\r\n        # First bison/3.7.1 with m4/1.4.19\r\n        self.build_requires(\"bison/3.7.1#47f49e709ddb9f8e055471c4e3c4e67d\"): # Fails\r\n\r\n        # Latest bison/3.7.1\r\n        #self.build_requires(\"bison/3.7.1#ad29e804e82c8b6d58765096676b5a5e\") # Fails\r\n```\r\n\r\n<img width=\"886\" alt=\"Screen Shot 2022-01-14 at 13 35 01\" src=\"https://user-images.githubusercontent.com/5479063/149528919-eff87be5-e7cc-4924-bb52-e67246e3cf1f.png\">\r\n\r\n\r\n\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n\r\n```\r\n[settings]\r\narch=x86_64\r\narch_build=x86_64\r\nbuild_type=Debug\r\ncompiler=Visual Studio\r\ncompiler.runtime=MDd\r\ncompiler.version=16\r\nos=Windows\r\nos_build=Windows\r\n[options]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n\r\n```\r\ngit clone git@github.com:NREL/conan-openstudio-ruby.git\r\ngit checkout update_ruby_installer_and_remotes\r\n\r\n'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat' x64\r\n\r\nconan create . openstudio_ruby/2.7.2@nrel/testing -b missing -b openstudio_ruby -s build_type=Debug\r\n```\r\n\r\n### Logs (Include/Attach if Applicable)\r\n\r\nExample of a failed run: https://github.com/NREL/conan-openstudio-ruby/runs/4787415523?check_suite_focus=true\r\n\n", "before_files": [{"content": "from conans import ConanFile, tools, AutoToolsBuildEnvironment\nfrom contextlib import contextmanager\nimport functools\nimport os\n\nrequired_conan_version = \">=1.33.0\"\n\n\nclass M4Conan(ConanFile):\n    name = \"m4\"\n    description = \"GNU M4 is an implementation of the traditional Unix macro processor\"\n    topics = (\"macro\", \"preprocessor\")\n    homepage = \"https://www.gnu.org/software/m4/\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"GPL-3.0-only\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n\n    exports_sources = \"patches/*.patch\",\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _settings_build(self):\n        return getattr(self, \"settings_build\", self.settings)\n\n    @property\n    def _is_msvc(self):\n        return self.settings.compiler == \"Visual Studio\"\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\" and not tools.get_env(\"CONAN_BASH_PATH\"):\n            self.build_requires(\"msys2/cci.latest\")\n\n    def package_id(self):\n        del self.info.settings.compiler\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    @functools.lru_cache(1)\n    def _configure_autotools(self):\n        conf_args = []\n        autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == \"Windows\")\n        build_canonical_name = None\n        host_canonical_name = None\n        if self.settings.compiler == \"Visual Studio\":\n            # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio\n            build_canonical_name = False\n            host_canonical_name = False\n            autotools.flags.append(\"-FS\")\n            # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug\n            # Visual Studio does not support the %n format flag:\n            # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions\n            # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,\n            # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.\n            conf_args.extend([\"gl_cv_func_printf_directive_n=no\", \"gl_cv_func_snprintf_directive_n=no\", \"gl_cv_func_snprintf_directive_n=no\"])\n            if self.settings.build_type in (\"Debug\", \"RelWithDebInfo\"):\n                autotools.link_flags.append(\"-PDB\")\n        elif self.settings.compiler == \"clang\":\n            if tools.Version(self.version) < \"1.4.19\":\n                autotools.flags.extend([\"-rtlib=compiler-rt\", \"-Wno-unused-command-line-argument\"])\n        autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name)\n        return autotools\n\n    @contextmanager\n    def _build_context(self):\n        if self.settings.compiler == \"Visual Studio\":\n            with tools.vcvars(self.settings):\n                env = {\n                    \"AR\": \"{}/build-aux/ar-lib lib\".format(tools.unix_path(self._source_subfolder)),\n                    \"CC\": \"cl -nologo\",\n                    \"CXX\": \"cl -nologo\",\n                    \"LD\": \"link\",\n                    \"NM\": \"dumpbin -symbols\",\n                    \"OBJDUMP\": \":\",\n                    \"RANLIB\": \":\",\n                    \"STRIP\": \":\",\n                }\n                with tools.environment_append(env):\n                    yield\n        else:\n            yield\n\n    def _patch_sources(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def build(self):\n        self._patch_sources()\n        with self._build_context():\n            autotools = self._configure_autotools()\n            autotools.make()\n            if tools.get_env(\"CONAN_RUN_TESTS\", False):\n                self.output.info(\"Running m4 checks...\")\n                with tools.chdir(\"tests\"):\n                    autotools.make(target=\"check\")\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        with self._build_context():\n            autotools = self._configure_autotools()\n            autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.libdirs = []\n\n        bin_path = os.path.join(self.package_folder, \"bin\")\n        self.output.info(\"Appending PATH environment variable: {}\".format(bin_path))\n        self.env_info.PATH.append(bin_path)\n\n        bin_ext = \".exe\" if self.settings.os == \"Windows\" else \"\"\n        m4_bin = os.path.join(self.package_folder, \"bin\", \"m4{}\".format(bin_ext)).replace(\"\\\\\", \"/\")\n\n        # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path\n        self.output.info(\"Setting M4 environment variable: {}\".format(m4_bin))\n        self.env_info.M4 = m4_bin\n", "path": "recipes/m4/all/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, tools, AutoToolsBuildEnvironment\nfrom contextlib import contextmanager\nimport functools\nimport os\n\nrequired_conan_version = \">=1.33.0\"\n\n\nclass M4Conan(ConanFile):\n    name = \"m4\"\n    description = \"GNU M4 is an implementation of the traditional Unix macro processor\"\n    topics = (\"macro\", \"preprocessor\")\n    homepage = \"https://www.gnu.org/software/m4/\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"GPL-3.0-only\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n\n    exports_sources = \"patches/*.patch\",\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _settings_build(self):\n        return getattr(self, \"settings_build\", self.settings)\n\n    @property\n    def _is_msvc(self):\n        return self.settings.compiler == \"Visual Studio\" or self.settings.compiler == \"msvc\"\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\" and not tools.get_env(\"CONAN_BASH_PATH\"):\n            self.build_requires(\"msys2/cci.latest\")\n\n    def package_id(self):\n        del self.info.settings.compiler\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    @functools.lru_cache(1)\n    def _configure_autotools(self):\n        conf_args = []\n        autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == \"Windows\")\n        build_canonical_name = None\n        host_canonical_name = None\n        if self._is_msvc:\n            # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio\n            build_canonical_name = False\n            host_canonical_name = False\n            autotools.flags.append(\"-FS\")\n            # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug\n            # Visual Studio does not support the %n format flag:\n            # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions\n            # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,\n            # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.\n            conf_args.extend([\"gl_cv_func_printf_directive_n=no\", \"gl_cv_func_snprintf_directive_n=no\", \"gl_cv_func_snprintf_directive_n=no\"])\n            if self.settings.build_type in (\"Debug\", \"RelWithDebInfo\"):\n                autotools.link_flags.append(\"-PDB\")\n        elif self.settings.compiler == \"clang\":\n            if tools.Version(self.version) < \"1.4.19\":\n                autotools.flags.extend([\"-rtlib=compiler-rt\", \"-Wno-unused-command-line-argument\"])\n        if self.settings.os == 'Windows':\n            conf_args.extend([\"ac_cv_func__set_invalid_parameter_handler=yes\"])\n\n        autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name)\n        return autotools\n\n    @contextmanager\n    def _build_context(self):\n        env = {\"PATH\": [os.path.abspath(self._source_subfolder)]}\n        if self._is_msvc:\n            with tools.vcvars(self.settings):\n                env.update({\n                    \"AR\": \"{}/build-aux/ar-lib lib\".format(tools.unix_path(self._source_subfolder)),\n                    \"CC\": \"cl -nologo\",\n                    \"CXX\": \"cl -nologo\",\n                    \"LD\": \"link\",\n                    \"NM\": \"dumpbin -symbols\",\n                    \"OBJDUMP\": \":\",\n                    \"RANLIB\": \":\",\n                    \"STRIP\": \":\",\n                })\n                with tools.environment_append(env):\n                    yield\n        else:\n            with tools.environment_append(env):\n                yield\n\n    def _patch_sources(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def build(self):\n        with tools.chdir(self._source_subfolder):\n            tools.save(\"help2man\", '#!/usr/bin/env bash\\n:')\n            if os.name == 'posix':\n                os.chmod(\"help2man\", os.stat(\"help2man\").st_mode | 0o111)\n        self._patch_sources()\n        with self._build_context():\n            autotools = self._configure_autotools()\n            autotools.make()\n            if tools.get_env(\"CONAN_RUN_TESTS\", False):\n                self.output.info(\"Running m4 checks...\")\n                with tools.chdir(\"tests\"):\n                    autotools.make(target=\"check\")\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        with self._build_context():\n            autotools = self._configure_autotools()\n            autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.libdirs = []\n\n        bin_path = os.path.join(self.package_folder, \"bin\")\n        self.output.info(\"Appending PATH environment variable: {}\".format(bin_path))\n        self.env_info.PATH.append(bin_path)\n\n        bin_ext = \".exe\" if self.settings.os == \"Windows\" else \"\"\n        m4_bin = os.path.join(self.package_folder, \"bin\", \"m4{}\".format(bin_ext)).replace(\"\\\\\", \"/\")\n\n        # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path\n        self.output.info(\"Setting M4 environment variable: {}\".format(m4_bin))\n        self.env_info.M4 = m4_bin\n", "path": "recipes/m4/all/conanfile.py"}]}