prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [package] resiprocate/1.12.0: Error in autotools configuration
  There are several errors in the recipe, especially in autotools configuration step.
  
  https://github.com/conan-io/conan-center-index/blob/c68b60af3de84cf460c7512efce75290f1b395cb/recipes/resiprocate/all/conanfile.py#L50-L58
  
  First, in the lines 54~57, values passed to each options are the inverse of what a consumer actually gave. For example, if `with_ssl` is true, then configuration option is passed as `--with-ssl=no`.
  
  Second, the configure script of the project doesn't understand value assignments to the following options : ssl, mysql, postgresql. In other words, `--with-ssl=yes` and `--with-ssl=no` would make no difference in the configuration step and eventually the library is built with ssl feature on in both cases. You can check this out either from resiprocate project's [`configure.ac` file](https://github.com/resiprocate/resiprocate/blob/6b2756ba8516726cfb04e2b2fa5f4e3e67598a31/configure.ac#L113-L119), or from `configure` file autogenerated from `configure.ac` as below. 
  
  ```
  # Check whether --with-ssl was given.
  if test "${with_ssl+set}" = set; then :
    withval=$with_ssl;
  cat >>confdefs.h <<_ACEOF
  #define USE_SSL /**/
  _ACEOF
  
   LIBSSL_LIBADD="-lssl -lcrypto"
  
    if true; then
    USE_SSL_TRUE=
    USE_SSL_FALSE='#'
  else
    USE_SSL_TRUE='#'
    USE_SSL_FALSE=
  fi
  
  else
     LIBSSL_LIBADD=""
  
  fi
  ```
  
  And lastly, the project requires pthread, and the recipe didn't include that. When I turn off ssl, mysql, postgresql options, linking the library causes pthread missing error. I guess pthread happened to be secondary dependency from ssl or mysql or postgresql library, and that's why it worked when the options were on even though the recipe didn't explicitly include pthread. I suggest we add pthread in `cpp_info.system_libs`
  
  I'm really thankful to those who had worked in this package. I didn't expect it to be on conan ever, but now it's so nice and easy to use. Happy holidays guys! 
  
  --- 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/resiprocate/all/conanfile.py`
  Content:
  ```
  1 import os
  2 from conans import ConanFile, AutoToolsBuildEnvironment, tools
  3 from conans.errors import ConanInvalidConfiguration
  4 
  5 
  6 required_conan_version = ">=1.29.1"
  7 
  8 class ResiprocateConan(ConanFile):
  9     name = "resiprocate"
  10     description = "The project is dedicated to maintaining a complete, correct, and commercially usable implementation of SIP and a few related protocols. "
  11     topics = ("sip", "voip", "communication", "signaling")
  12     url = "https://github.com/conan-io/conan-center-index"
  13     homepage = "http://www.resiprocate.org"
  14     license = "VSL-1.0"
  15     settings = "os", "compiler", "build_type", "arch"
  16     options = {"fPIC": [True, False],
  17                "shared": [True, False],
  18                "with_ssl": [True, False],
  19                "with_postgresql": [True, False],
  20                "with_mysql": [True, False]}
  21     default_options = {"fPIC": True,
  22                        "shared": False,
  23                        "with_ssl": True,
  24                        "with_postgresql": True,
  25                        "with_mysql": True}
  26     _autotools = None
  27 
  28     @property
  29     def _source_subfolder(self):
  30         return "source_subfolder"
  31 
  32     def requirements(self):
  33         if self.settings.os in ("Windows", "Macos"):
  34             raise ConanInvalidConfiguration("reSIProcate is not support on {}.".format(self.settings.os))
  35         if self.options.with_ssl:
  36             self.requires("openssl/1.1.1h")
  37         if self.options.with_postgresql:
  38             self.requires("libpq/11.5")
  39         if self.options.with_mysql:
  40             self.requires("libmysqlclient/8.0.17")
  41 
  42     def source(self):
  43         tools.get(**self.conan_data["sources"][self.version])
  44         os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
  45 
  46     def _configure_autotools(self):
  47         if self._autotools:
  48             return self._autotools
  49         self._autotools = AutoToolsBuildEnvironment(self)
  50         yes_no = lambda v: "yes" if v else "no"
  51         configure_args = [
  52             "--enable-shared={}".format(yes_no(self.options.shared)),
  53             "--enable-static={}".format(yes_no(not self.options.shared)),
  54             "--with-ssl={}".format(yes_no(not self.options.with_ssl)),
  55             "--with-mysql={}".format(yes_no(not self.options.with_mysql)),
  56             "--with-postgresql={}".format(yes_no(not self.options.with_postgresql)),
  57             "--with-pic={}".format(yes_no(not self.options.fPIC))
  58         ]
  59 
  60         self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args)
  61         return self._autotools
  62 
  63     def build(self):
  64         autotools = self._configure_autotools()
  65         autotools.make()
  66 
  67     def package(self):
  68         self.copy("COPYING", src=self._source_subfolder, dst="licenses")
  69         autotools = self._configure_autotools()
  70         autotools.install()
  71         tools.rmdir(os.path.join(os.path.join(self.package_folder, "share")))
  72         tools.remove_files_by_mask(os.path.join(self.package_folder), "*.la")
  73 
  74     def package_info(self):
  75         self.cpp_info.libs = ["resip", "rutil", "dum", "resipares"]
  76         bin_path = os.path.join(self.package_folder, "bin")
  77         self.output.info("Appending PATH environment variable: {}".format(bin_path))
  78         self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
  79
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/recipes/resiprocate/all/conanfile.py b/recipes/resiprocate/all/conanfile.py
  --- a/recipes/resiprocate/all/conanfile.py
  +++ b/recipes/resiprocate/all/conanfile.py
  @@ -29,13 +29,22 @@
       def _source_subfolder(self):
           return "source_subfolder"
   
  -    def requirements(self):
  +    def config_options(self):
  +        if self.settings.os == 'Windows':
  +            del self.options.fPIC
  +
  +    def configure(self):
           if self.settings.os in ("Windows", "Macos"):
  -            raise ConanInvalidConfiguration("reSIProcate is not support on {}.".format(self.settings.os))
  +            # FIXME: Visual Studio project & Mac support seems available in resiprocate
  +            raise ConanInvalidConfiguration("reSIProcate recipe does not currently support {}.".format(self.settings.os))
  +        if self.options.shared:
  +            del self.options.fPIC
  +
  +    def requirements(self):
           if self.options.with_ssl:
  -            self.requires("openssl/1.1.1h")
  +            self.requires("openssl/1.1.1i")
           if self.options.with_postgresql:
  -            self.requires("libpq/11.5")
  +            self.requires("libpq/11.9")
           if self.options.with_mysql:
               self.requires("libmysqlclient/8.0.17")
   
  @@ -51,12 +60,17 @@
           configure_args = [
               "--enable-shared={}".format(yes_no(self.options.shared)),
               "--enable-static={}".format(yes_no(not self.options.shared)),
  -            "--with-ssl={}".format(yes_no(not self.options.with_ssl)),
  -            "--with-mysql={}".format(yes_no(not self.options.with_mysql)),
  -            "--with-postgresql={}".format(yes_no(not self.options.with_postgresql)),
  -            "--with-pic={}".format(yes_no(not self.options.fPIC))
  +            "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True)))
           ]
   
  +        # These options do not support yes/no
  +        if self.options.with_ssl:
  +            configure_args.append("--with-ssl")
  +        if self.options.with_mysql:
  +            configure_args.append("--with-mysql")
  +        if self.options.with_postgresql:
  +            configure_args.append("--with-postgresql")
  +        
           self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args)
           return self._autotools
   
  @@ -73,6 +87,8 @@
   
       def package_info(self):
           self.cpp_info.libs = ["resip", "rutil", "dum", "resipares"]
  +        if self.settings.os in ("Linux", "FreeBSD"):
  +            self.cpp_info.system_libs = ["pthread"]
           bin_path = os.path.join(self.package_folder, "bin")
           self.output.info("Appending PATH environment variable: {}".format(bin_path))
           self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
  
verification_info: {"golden_diff": "diff --git a/recipes/resiprocate/all/conanfile.py b/recipes/resiprocate/all/conanfile.py\n--- a/recipes/resiprocate/all/conanfile.py\n+++ b/recipes/resiprocate/all/conanfile.py\n@@ -29,13 +29,22 @@\n     def _source_subfolder(self):\n         return \"source_subfolder\"\n \n-    def requirements(self):\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.os in (\"Windows\", \"Macos\"):\n-            raise ConanInvalidConfiguration(\"reSIProcate is not support on {}.\".format(self.settings.os))\n+            # FIXME: Visual Studio project & Mac support seems available in resiprocate\n+            raise ConanInvalidConfiguration(\"reSIProcate recipe does not currently support {}.\".format(self.settings.os))\n+        if self.options.shared:\n+            del self.options.fPIC\n+\n+    def requirements(self):\n         if self.options.with_ssl:\n-            self.requires(\"openssl/1.1.1h\")\n+            self.requires(\"openssl/1.1.1i\")\n         if self.options.with_postgresql:\n-            self.requires(\"libpq/11.5\")\n+            self.requires(\"libpq/11.9\")\n         if self.options.with_mysql:\n             self.requires(\"libmysqlclient/8.0.17\")\n \n@@ -51,12 +60,17 @@\n         configure_args = [\n             \"--enable-shared={}\".format(yes_no(self.options.shared)),\n             \"--enable-static={}\".format(yes_no(not self.options.shared)),\n-            \"--with-ssl={}\".format(yes_no(not self.options.with_ssl)),\n-            \"--with-mysql={}\".format(yes_no(not self.options.with_mysql)),\n-            \"--with-postgresql={}\".format(yes_no(not self.options.with_postgresql)),\n-            \"--with-pic={}\".format(yes_no(not self.options.fPIC))\n+            \"--with-pic={}\".format(yes_no(self.options.get_safe(\"fPIC\", True)))\n         ]\n \n+        # These options do not support yes/no\n+        if self.options.with_ssl:\n+            configure_args.append(\"--with-ssl\")\n+        if self.options.with_mysql:\n+            configure_args.append(\"--with-mysql\")\n+        if self.options.with_postgresql:\n+            configure_args.append(\"--with-postgresql\")\n+        \n         self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args)\n         return self._autotools\n \n@@ -73,6 +87,8 @@\n \n     def package_info(self):\n         self.cpp_info.libs = [\"resip\", \"rutil\", \"dum\", \"resipares\"]\n+        if self.settings.os in (\"Linux\", \"FreeBSD\"):\n+            self.cpp_info.system_libs = [\"pthread\"]\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(os.path.join(self.package_folder, \"bin\"))\n", "issue": "[package] resiprocate/1.12.0: Error in autotools configuration\nThere are several errors in the recipe, especially in autotools configuration step.\r\n\r\nhttps://github.com/conan-io/conan-center-index/blob/c68b60af3de84cf460c7512efce75290f1b395cb/recipes/resiprocate/all/conanfile.py#L50-L58\r\n\r\nFirst, in the lines 54~57, values passed to each options are the inverse of what a consumer actually gave. For example, if `with_ssl` is true, then configuration option is passed as `--with-ssl=no`.\r\n\r\nSecond, the configure script of the project doesn't understand value assignments to the following options : ssl, mysql, postgresql. In other words, `--with-ssl=yes` and `--with-ssl=no` would make no difference in the configuration step and eventually the library is built with ssl feature on in both cases. You can check this out either from resiprocate project's [`configure.ac` file](https://github.com/resiprocate/resiprocate/blob/6b2756ba8516726cfb04e2b2fa5f4e3e67598a31/configure.ac#L113-L119), or from `configure` file autogenerated from `configure.ac` as below. \r\n\r\n```\r\n# Check whether --with-ssl was given.\r\nif test \"${with_ssl+set}\" = set; then :\r\n  withval=$with_ssl;\r\ncat >>confdefs.h <<_ACEOF\r\n#define USE_SSL /**/\r\n_ACEOF\r\n\r\n LIBSSL_LIBADD=\"-lssl -lcrypto\"\r\n\r\n  if true; then\r\n  USE_SSL_TRUE=\r\n  USE_SSL_FALSE='#'\r\nelse\r\n  USE_SSL_TRUE='#'\r\n  USE_SSL_FALSE=\r\nfi\r\n\r\nelse\r\n   LIBSSL_LIBADD=\"\"\r\n\r\nfi\r\n```\r\n\r\nAnd lastly, the project requires pthread, and the recipe didn't include that. When I turn off ssl, mysql, postgresql options, linking the library causes pthread missing error. I guess pthread happened to be secondary dependency from ssl or mysql or postgresql library, and that's why it worked when the options were on even though the recipe didn't explicitly include pthread. I suggest we add pthread in `cpp_info.system_libs`\r\n\r\nI'm really thankful to those who had worked in this package. I didn't expect it to be on conan ever, but now it's so nice and easy to use. Happy holidays guys! \n", "before_files": [{"content": "import os\nfrom conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\n\n\nrequired_conan_version = \">=1.29.1\"\n\nclass ResiprocateConan(ConanFile):\n    name = \"resiprocate\"\n    description = \"The project is dedicated to maintaining a complete, correct, and commercially usable implementation of SIP and a few related protocols. \"\n    topics = (\"sip\", \"voip\", \"communication\", \"signaling\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"http://www.resiprocate.org\"\n    license = \"VSL-1.0\"\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\"fPIC\": [True, False],\n               \"shared\": [True, False],\n               \"with_ssl\": [True, False],\n               \"with_postgresql\": [True, False],\n               \"with_mysql\": [True, False]}\n    default_options = {\"fPIC\": True,\n                       \"shared\": False,\n                       \"with_ssl\": True,\n                       \"with_postgresql\": True,\n                       \"with_mysql\": True}\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    def requirements(self):\n        if self.settings.os in (\"Windows\", \"Macos\"):\n            raise ConanInvalidConfiguration(\"reSIProcate is not support on {}.\".format(self.settings.os))\n        if self.options.with_ssl:\n            self.requires(\"openssl/1.1.1h\")\n        if self.options.with_postgresql:\n            self.requires(\"libpq/11.5\")\n        if self.options.with_mysql:\n            self.requires(\"libmysqlclient/8.0.17\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"{}-{}\".format(self.name, self.version), self._source_subfolder)\n\n    def _configure_autotools(self):\n        if self._autotools:\n            return self._autotools\n        self._autotools = AutoToolsBuildEnvironment(self)\n        yes_no = lambda v: \"yes\" if v else \"no\"\n        configure_args = [\n            \"--enable-shared={}\".format(yes_no(self.options.shared)),\n            \"--enable-static={}\".format(yes_no(not self.options.shared)),\n            \"--with-ssl={}\".format(yes_no(not self.options.with_ssl)),\n            \"--with-mysql={}\".format(yes_no(not self.options.with_mysql)),\n            \"--with-postgresql={}\".format(yes_no(not self.options.with_postgresql)),\n            \"--with-pic={}\".format(yes_no(not self.options.fPIC))\n        ]\n\n        self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args)\n        return self._autotools\n\n    def build(self):\n        autotools = self._configure_autotools()\n        autotools.make()\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        autotools = self._configure_autotools()\n        autotools.install()\n        tools.rmdir(os.path.join(os.path.join(self.package_folder, \"share\")))\n        tools.remove_files_by_mask(os.path.join(self.package_folder), \"*.la\")\n\n    def package_info(self):\n        self.cpp_info.libs = [\"resip\", \"rutil\", \"dum\", \"resipares\"]\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(os.path.join(self.package_folder, \"bin\"))\n", "path": "recipes/resiprocate/all/conanfile.py"}], "after_files": [{"content": "import os\nfrom conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\n\n\nrequired_conan_version = \">=1.29.1\"\n\nclass ResiprocateConan(ConanFile):\n    name = \"resiprocate\"\n    description = \"The project is dedicated to maintaining a complete, correct, and commercially usable implementation of SIP and a few related protocols. \"\n    topics = (\"sip\", \"voip\", \"communication\", \"signaling\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"http://www.resiprocate.org\"\n    license = \"VSL-1.0\"\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\"fPIC\": [True, False],\n               \"shared\": [True, False],\n               \"with_ssl\": [True, False],\n               \"with_postgresql\": [True, False],\n               \"with_mysql\": [True, False]}\n    default_options = {\"fPIC\": True,\n                       \"shared\": False,\n                       \"with_ssl\": True,\n                       \"with_postgresql\": True,\n                       \"with_mysql\": True}\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\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.os in (\"Windows\", \"Macos\"):\n            # FIXME: Visual Studio project & Mac support seems available in resiprocate\n            raise ConanInvalidConfiguration(\"reSIProcate recipe does not currently support {}.\".format(self.settings.os))\n        if self.options.shared:\n            del self.options.fPIC\n\n    def requirements(self):\n        if self.options.with_ssl:\n            self.requires(\"openssl/1.1.1i\")\n        if self.options.with_postgresql:\n            self.requires(\"libpq/11.9\")\n        if self.options.with_mysql:\n            self.requires(\"libmysqlclient/8.0.17\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"{}-{}\".format(self.name, self.version), self._source_subfolder)\n\n    def _configure_autotools(self):\n        if self._autotools:\n            return self._autotools\n        self._autotools = AutoToolsBuildEnvironment(self)\n        yes_no = lambda v: \"yes\" if v else \"no\"\n        configure_args = [\n            \"--enable-shared={}\".format(yes_no(self.options.shared)),\n            \"--enable-static={}\".format(yes_no(not self.options.shared)),\n            \"--with-pic={}\".format(yes_no(self.options.get_safe(\"fPIC\", True)))\n        ]\n\n        # These options do not support yes/no\n        if self.options.with_ssl:\n            configure_args.append(\"--with-ssl\")\n        if self.options.with_mysql:\n            configure_args.append(\"--with-mysql\")\n        if self.options.with_postgresql:\n            configure_args.append(\"--with-postgresql\")\n        \n        self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args)\n        return self._autotools\n\n    def build(self):\n        autotools = self._configure_autotools()\n        autotools.make()\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        autotools = self._configure_autotools()\n        autotools.install()\n        tools.rmdir(os.path.join(os.path.join(self.package_folder, \"share\")))\n        tools.remove_files_by_mask(os.path.join(self.package_folder), \"*.la\")\n\n    def package_info(self):\n        self.cpp_info.libs = [\"resip\", \"rutil\", \"dum\", \"resipares\"]\n        if self.settings.os in (\"Linux\", \"FreeBSD\"):\n            self.cpp_info.system_libs = [\"pthread\"]\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(os.path.join(self.package_folder, \"bin\"))\n", "path": "recipes/resiprocate/all/conanfile.py"}]}