We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] gmp/6.1.2: can't be built with mingw
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **gmp/6.1.2**
  * Operating System+version: **Windows 10 1903**
  * Compiler+version: **GCC 8**
  * Conan version: **conan 1.19.1**
  * Python version: **Python 3.7.3**

### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.exception=seh
compiler.libcxx=libstdc++11
compiler.threads=posix
build_type=Release
[options]
[build_requires]
*: mingw_installer/1.0@conan/stable, msys2_installer/latest@bincrafters/stable
[env]
```

### Steps to reproduce (Include if Applicable)
conanfile.txt
```
[requires]
gmp/6.1.2@bincrafters/stable

[generators]
txt
```

Running from Git bash
```
conan install --profile mingw -o gmp:disable_assembly=False -o gmp:enable_cxx=False -o gmp:fPIC=True -o gmp:run_checks=True -o gmp:shared=True --build gmp ../build_gmp
```

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
gmp/6.1.2@bincrafters/stable: Copying sources to build folder
gmp/6.1.2@bincrafters/stable: Building your package in C:\.conan\data\gmp\6.1.2\bincrafters\stable\build\92709a555eae5613e66076e2183cc3e52e0cd0e5
gmp/6.1.2@bincrafters/stable: Generator txt created conanbuildinfo.txt
gmp/6.1.2@bincrafters/stable: Calling build()
gmp/6.1.2@bincrafters/stable: WARN: Error running `configure --help`: Error 1 while executing source_subfolder/configure --help
gmp/6.1.2@bincrafters/stable: Calling:
 > source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5
'source_subfolder' is not recognized as an internal or external command,
operable program or batch file.
gmp/6.1.2@bincrafters/stable:
gmp/6.1.2@bincrafters/stable: ERROR: Package '92709a555eae5613e66076e2183cc3e52e0cd0e5' build failed
gmp/6.1.2@bincrafters/stable: WARN: Build folder C:\.conan\data\gmp\6.1.2\bincrafters\stable\build\92709a555eae5613e66076e2183cc3e52e0cd0e5
ERROR: gmp/6.1.2@bincrafters/stable: Error in build() method, line 66
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 62
        self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)
        ConanException: Error 1 while executing source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5
```
</details>

Replacing
```self._autotools = AutoToolsBuildEnvironment(self)```
with
```self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)```
allows to go further.

<details><summary>Click to expand log</summary>

```
gmp/6.1.2@bincrafters/stable: checking if the .align directive accepts an 0x90 fill in .text... yes
gmp/6.1.2@bincrafters/stable: checking size of void *... 8
gmp/6.1.2@bincrafters/stable: checking size of unsigned short... 2
gmp/6.1.2@bincrafters/stable: checking size of unsigned... 4
gmp/6.1.2@bincrafters/stable: checking size of unsigned long... 4
gmp/6.1.2@bincrafters/stable: checking size of mp_limb_t... 0
gmp/6.1.2@bincrafters/stable: configure: error: Oops, mp_limb_t doesn't seem to work
gmp/6.1.2@bincrafters/stable:
gmp/6.1.2@bincrafters/stable: ERROR: Package '92709a555eae5613e66076e2183cc3e52e0cd0e5' build failed
gmp/6.1.2@bincrafters/stable: WARN: Build folder C:\.conan\data\gmp\6.1.2\bincrafters\stable\build\92709a555eae5613e66076e2183cc3e52e0cd0e5
ERROR: gmp/6.1.2@bincrafters/stable: Error in build() method, line 66
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 62
        self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)
        ConanException: Error 1 while executing /c/.conan/data/gmp/6.1.2/bincrafters/stable/build/92709a555eae5613e66076e2183cc3e52e0cd0e5/source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5
```
</details>

Next I've tried adding 
```with tools.chdir(self._source_subfolder):```
to build and package steps for autotools. And removed ```configure_dir=self._source_subfolder``` from ```self._autotools.configure```

This has allowed me to build gmp but I'm not sure that it is the right way.


--- 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/gmp/all/conanfile.py`
Content:
```
1 import os
2 import stat
3 from conans import ConanFile, AutoToolsBuildEnvironment, tools
4 from conans.errors import ConanInvalidConfiguration
5 
6 
7 class GmpConan(ConanFile):
8     name = "gmp"
9     description = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers."
10     url = "https://github.com/conan-io/conan-center-index"
11     topics = ("conan", "gmp", "math")
12     license = ("LGPL-3.0", "GPL-2.0")
13     homepage = "https://gmplib.org"
14     settings = "os", "arch", "compiler", "build_type"
15     options = {"shared": [True, False], "fPIC": [True, False], "disable_assembly": [True, False],
16                "run_checks": [True, False], "enable_cxx" : [True, False]}
17     default_options = {'shared': False, 'fPIC': True, 'disable_assembly': True, 'run_checks': False, "enable_cxx" : True}
18 
19     _source_subfolder = "source_subfolder"
20     _autotools = None
21 
22     def config_options(self):
23         if self.settings.os == "Windows":
24             del self.options.fPIC
25 
26     def configure(self):
27         if self.settings.compiler == 'Visual Studio':
28             raise ConanInvalidConfiguration("The gmp package cannot be built on Visual Studio.")
29 
30         if not self.options.enable_cxx:
31             del self.settings.compiler.libcxx
32             del self.settings.compiler.cppstd
33 
34     def source(self):
35         tools.get(**self.conan_data["sources"][self.version])
36         os.rename("gmp-" + self.version, self._source_subfolder)
37 
38     def _configure_autotools(self):
39         if not self._autotools:
40             self._autotools = AutoToolsBuildEnvironment(self)
41             if self.settings.os == "Macos":
42                 configure_file = os.path.join(self._source_subfolder, "configure")
43                 tools.replace_in_file(configure_file, r"-install_name \$rpath/", "-install_name ")
44                 configure_stats = os.stat(configure_file)
45                 os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC)
46             configure_args = []
47             if self.options.disable_assembly:
48                 configure_args.append('--disable-assembly')
49             if self.options.shared:
50                 configure_args.extend(["--enable-shared", "--disable-static"])
51             else:
52                 configure_args.extend(["--disable-shared", "--enable-static"])
53             if self.options.enable_cxx:
54                 configure_args.append('--enable-cxx')
55             self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)
56         return self._autotools
57 
58     def build(self):
59         autotools = self._configure_autotools()
60         autotools.make()
61         # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server.
62         if self.options.run_checks:
63             autotools.make(args=['check'])
64 
65     def package(self):
66         self.copy("COPYINGv2", dst="licenses", src=self._source_subfolder)
67         self.copy("COPYING.LESSERv3", dst="licenses", src=self._source_subfolder)
68         autotools = self._configure_autotools()
69         autotools.install()
70         tools.rmdir(os.path.join(self.package_folder, "share"))
71         # remove la files
72         for la_name in ['libgmp.la', 'libgmpxx.la']:
73             la = os.path.join(self.package_folder, "lib", la_name)
74             if os.path.isfile(la):
75                 os.unlink(la)
76 
77     def package_id(self):
78         del self.info.options.run_checks  # run_checks doesn't affect package's ID
79 
80     def package_info(self):
81         self.cpp_info.libs = tools.collect_libs(self)
82         self.cpp_info.name = "GMP"
83
```
--- 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/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py
--- a/recipes/gmp/all/conanfile.py
+++ b/recipes/gmp/all/conanfile.py
@@ -37,9 +37,9 @@
 
     def _configure_autotools(self):
         if not self._autotools:
-            self._autotools = AutoToolsBuildEnvironment(self)
+            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
             if self.settings.os == "Macos":
-                configure_file = os.path.join(self._source_subfolder, "configure")
+                configure_file = "configure"
                 tools.replace_in_file(configure_file, r"-install_name \$rpath/", "-install_name ")
                 configure_stats = os.stat(configure_file)
                 os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC)
@@ -52,12 +52,13 @@
                 configure_args.extend(["--disable-shared", "--enable-static"])
             if self.options.enable_cxx:
                 configure_args.append('--enable-cxx')
-            self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)
+            self._autotools.configure(args=configure_args)
         return self._autotools
 
     def build(self):
-        autotools = self._configure_autotools()
-        autotools.make()
+        with tools.chdir(self._source_subfolder):
+            autotools = self._configure_autotools()
+            autotools.make()
         # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server.
         if self.options.run_checks:
             autotools.make(args=['check'])
@@ -65,8 +66,9 @@
     def package(self):
         self.copy("COPYINGv2", dst="licenses", src=self._source_subfolder)
         self.copy("COPYING.LESSERv3", dst="licenses", src=self._source_subfolder)
-        autotools = self._configure_autotools()
-        autotools.install()
+        with tools.chdir(self._source_subfolder):
+            autotools = self._configure_autotools()
+            autotools.install()
         tools.rmdir(os.path.join(self.package_folder, "share"))
         # remove la files
         for la_name in ['libgmp.la', 'libgmpxx.la']:

{"golden_diff": "diff --git a/recipes/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py\n--- a/recipes/gmp/all/conanfile.py\n+++ b/recipes/gmp/all/conanfile.py\n@@ -37,9 +37,9 @@\n \n     def _configure_autotools(self):\n         if not self._autotools:\n-            self._autotools = AutoToolsBuildEnvironment(self)\n+            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n             if self.settings.os == \"Macos\":\n-                configure_file = os.path.join(self._source_subfolder, \"configure\")\n+                configure_file = \"configure\"\n                 tools.replace_in_file(configure_file, r\"-install_name \\$rpath/\", \"-install_name \")\n                 configure_stats = os.stat(configure_file)\n                 os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC)\n@@ -52,12 +52,13 @@\n                 configure_args.extend([\"--disable-shared\", \"--enable-static\"])\n             if self.options.enable_cxx:\n                 configure_args.append('--enable-cxx')\n-            self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\n+            self._autotools.configure(args=configure_args)\n         return self._autotools\n \n     def build(self):\n-        autotools = self._configure_autotools()\n-        autotools.make()\n+        with tools.chdir(self._source_subfolder):\n+            autotools = self._configure_autotools()\n+            autotools.make()\n         # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server.\n         if self.options.run_checks:\n             autotools.make(args=['check'])\n@@ -65,8 +66,9 @@\n     def package(self):\n         self.copy(\"COPYINGv2\", dst=\"licenses\", src=self._source_subfolder)\n         self.copy(\"COPYING.LESSERv3\", dst=\"licenses\", src=self._source_subfolder)\n-        autotools = self._configure_autotools()\n-        autotools.install()\n+        with tools.chdir(self._source_subfolder):\n+            autotools = self._configure_autotools()\n+            autotools.install()\n         tools.rmdir(os.path.join(self.package_folder, \"share\"))\n         # remove la files\n         for la_name in ['libgmp.la', 'libgmpxx.la']:\n", "issue": "[package] gmp/6.1.2: can't be built with mingw\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **gmp/6.1.2**\r\n  * Operating System+version: **Windows 10 1903**\r\n  * Compiler+version: **GCC 8**\r\n  * Conan version: **conan 1.19.1**\r\n  * Python version: **Python 3.7.3**\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[settings]\r\nos=Windows\r\nos_build=Windows\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=8\r\ncompiler.exception=seh\r\ncompiler.libcxx=libstdc++11\r\ncompiler.threads=posix\r\nbuild_type=Release\r\n[options]\r\n[build_requires]\r\n*: mingw_installer/1.0@conan/stable, msys2_installer/latest@bincrafters/stable\r\n[env]\r\n```\r\n\r\n### Steps to reproduce (Include if Applicable)\r\nconanfile.txt\r\n```\r\n[requires]\r\ngmp/6.1.2@bincrafters/stable\r\n\r\n[generators]\r\ntxt\r\n```\r\n\r\nRunning from Git bash\r\n```\r\nconan install --profile mingw -o gmp:disable_assembly=False -o gmp:enable_cxx=False -o gmp:fPIC=True -o gmp:run_checks=True -o gmp:shared=True --build gmp ../build_gmp\r\n```\r\n\r\n### Logs (Include/Attach if Applicable)\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\ngmp/6.1.2@bincrafters/stable: Copying sources to build folder\r\ngmp/6.1.2@bincrafters/stable: Building your package in C:\\.conan\\data\\gmp\\6.1.2\\bincrafters\\stable\\build\\92709a555eae5613e66076e2183cc3e52e0cd0e5\r\ngmp/6.1.2@bincrafters/stable: Generator txt created conanbuildinfo.txt\r\ngmp/6.1.2@bincrafters/stable: Calling build()\r\ngmp/6.1.2@bincrafters/stable: WARN: Error running `configure --help`: Error 1 while executing source_subfolder/configure --help\r\ngmp/6.1.2@bincrafters/stable: Calling:\r\n > source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5\r\n'source_subfolder' is not recognized as an internal or external command,\r\noperable program or batch file.\r\ngmp/6.1.2@bincrafters/stable:\r\ngmp/6.1.2@bincrafters/stable: ERROR: Package '92709a555eae5613e66076e2183cc3e52e0cd0e5' build failed\r\ngmp/6.1.2@bincrafters/stable: WARN: Build folder C:\\.conan\\data\\gmp\\6.1.2\\bincrafters\\stable\\build\\92709a555eae5613e66076e2183cc3e52e0cd0e5\r\nERROR: gmp/6.1.2@bincrafters/stable: Error in build() method, line 66\r\n        autotools = self._configure_autotools()\r\nwhile calling '_configure_autotools', line 62\r\n        self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\r\n        ConanException: Error 1 while executing source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5\r\n```\r\n</details>\r\n\r\nReplacing\r\n```self._autotools = AutoToolsBuildEnvironment(self)```\r\nwith\r\n```self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)```\r\nallows to go further.\r\n\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\ngmp/6.1.2@bincrafters/stable: checking if the .align directive accepts an 0x90 fill in .text... yes\r\ngmp/6.1.2@bincrafters/stable: checking size of void *... 8\r\ngmp/6.1.2@bincrafters/stable: checking size of unsigned short... 2\r\ngmp/6.1.2@bincrafters/stable: checking size of unsigned... 4\r\ngmp/6.1.2@bincrafters/stable: checking size of unsigned long... 4\r\ngmp/6.1.2@bincrafters/stable: checking size of mp_limb_t... 0\r\ngmp/6.1.2@bincrafters/stable: configure: error: Oops, mp_limb_t doesn't seem to work\r\ngmp/6.1.2@bincrafters/stable:\r\ngmp/6.1.2@bincrafters/stable: ERROR: Package '92709a555eae5613e66076e2183cc3e52e0cd0e5' build failed\r\ngmp/6.1.2@bincrafters/stable: WARN: Build folder C:\\.conan\\data\\gmp\\6.1.2\\bincrafters\\stable\\build\\92709a555eae5613e66076e2183cc3e52e0cd0e5\r\nERROR: gmp/6.1.2@bincrafters/stable: Error in build() method, line 66\r\n        autotools = self._configure_autotools()\r\nwhile calling '_configure_autotools', line 62\r\n        self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\r\n        ConanException: Error 1 while executing /c/.conan/data/gmp/6.1.2/bincrafters/stable/build/92709a555eae5613e66076e2183cc3e52e0cd0e5/source_subfolder/configure --enable-shared --disable-static --prefix=C:/.conan/data/gmp/6.1.2/bincrafters/stable/package/92709a555eae5613e66076e2183cc3e52e0cd0e5\r\n```\r\n</details>\r\n\r\nNext I've tried adding \r\n```with tools.chdir(self._source_subfolder):```\r\nto build and package steps for autotools. And removed ```configure_dir=self._source_subfolder``` from ```self._autotools.configure```\r\n\r\nThis has allowed me to build gmp but I'm not sure that it is the right way.\r\n\n", "before_files": [{"content": "import os\nimport stat\nfrom conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\n\n\nclass GmpConan(ConanFile):\n    name = \"gmp\"\n    description = \"GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    topics = (\"conan\", \"gmp\", \"math\")\n    license = (\"LGPL-3.0\", \"GPL-2.0\")\n    homepage = \"https://gmplib.org\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False], \"disable_assembly\": [True, False],\n               \"run_checks\": [True, False], \"enable_cxx\" : [True, False]}\n    default_options = {'shared': False, 'fPIC': True, 'disable_assembly': True, 'run_checks': False, \"enable_cxx\" : True}\n\n    _source_subfolder = \"source_subfolder\"\n    _autotools = None\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.settings.compiler == 'Visual Studio':\n            raise ConanInvalidConfiguration(\"The gmp package cannot be built on Visual Studio.\")\n\n        if not self.options.enable_cxx:\n            del self.settings.compiler.libcxx\n            del self.settings.compiler.cppstd\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"gmp-\" + self.version, self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self)\n            if self.settings.os == \"Macos\":\n                configure_file = os.path.join(self._source_subfolder, \"configure\")\n                tools.replace_in_file(configure_file, r\"-install_name \\$rpath/\", \"-install_name \")\n                configure_stats = os.stat(configure_file)\n                os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC)\n            configure_args = []\n            if self.options.disable_assembly:\n                configure_args.append('--disable-assembly')\n            if self.options.shared:\n                configure_args.extend([\"--enable-shared\", \"--disable-static\"])\n            else:\n                configure_args.extend([\"--disable-shared\", \"--enable-static\"])\n            if self.options.enable_cxx:\n                configure_args.append('--enable-cxx')\n            self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    def build(self):\n        autotools = self._configure_autotools()\n        autotools.make()\n        # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server.\n        if self.options.run_checks:\n            autotools.make(args=['check'])\n\n    def package(self):\n        self.copy(\"COPYINGv2\", dst=\"licenses\", src=self._source_subfolder)\n        self.copy(\"COPYING.LESSERv3\", dst=\"licenses\", src=self._source_subfolder)\n        autotools = self._configure_autotools()\n        autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n        # remove la files\n        for la_name in ['libgmp.la', 'libgmpxx.la']:\n            la = os.path.join(self.package_folder, \"lib\", la_name)\n            if os.path.isfile(la):\n                os.unlink(la)\n\n    def package_id(self):\n        del self.info.options.run_checks  # run_checks doesn't affect package's ID\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        self.cpp_info.name = \"GMP\"\n", "path": "recipes/gmp/all/conanfile.py"}], "after_files": [{"content": "import os\nimport stat\nfrom conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\n\n\nclass GmpConan(ConanFile):\n    name = \"gmp\"\n    description = \"GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    topics = (\"conan\", \"gmp\", \"math\")\n    license = (\"LGPL-3.0\", \"GPL-2.0\")\n    homepage = \"https://gmplib.org\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False], \"disable_assembly\": [True, False],\n               \"run_checks\": [True, False], \"enable_cxx\" : [True, False]}\n    default_options = {'shared': False, 'fPIC': True, 'disable_assembly': True, 'run_checks': False, \"enable_cxx\" : True}\n\n    _source_subfolder = \"source_subfolder\"\n    _autotools = None\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.settings.compiler == 'Visual Studio':\n            raise ConanInvalidConfiguration(\"The gmp package cannot be built on Visual Studio.\")\n\n        if not self.options.enable_cxx:\n            del self.settings.compiler.libcxx\n            del self.settings.compiler.cppstd\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"gmp-\" + self.version, self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n            if self.settings.os == \"Macos\":\n                configure_file = \"configure\"\n                tools.replace_in_file(configure_file, r\"-install_name \\$rpath/\", \"-install_name \")\n                configure_stats = os.stat(configure_file)\n                os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC)\n            configure_args = []\n            if self.options.disable_assembly:\n                configure_args.append('--disable-assembly')\n            if self.options.shared:\n                configure_args.extend([\"--enable-shared\", \"--disable-static\"])\n            else:\n                configure_args.extend([\"--disable-shared\", \"--enable-static\"])\n            if self.options.enable_cxx:\n                configure_args.append('--enable-cxx')\n            self._autotools.configure(args=configure_args)\n        return self._autotools\n\n    def build(self):\n        with tools.chdir(self._source_subfolder):\n            autotools = self._configure_autotools()\n            autotools.make()\n        # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server.\n        if self.options.run_checks:\n            autotools.make(args=['check'])\n\n    def package(self):\n        self.copy(\"COPYINGv2\", dst=\"licenses\", src=self._source_subfolder)\n        self.copy(\"COPYING.LESSERv3\", dst=\"licenses\", src=self._source_subfolder)\n        with tools.chdir(self._source_subfolder):\n            autotools = self._configure_autotools()\n            autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n        # remove la files\n        for la_name in ['libgmp.la', 'libgmpxx.la']:\n            la = os.path.join(self.package_folder, \"lib\", la_name)\n            if os.path.isfile(la):\n                os.unlink(la)\n\n    def package_id(self):\n        del self.info.options.run_checks  # run_checks doesn't affect package's ID\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        self.cpp_info.name = \"GMP\"\n", "path": "recipes/gmp/all/conanfile.py"}]}