-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Environment Details (include every applicable attribute)
- Operating System+version: Ubuntu 20.04
- Compiler+version: gcc-9
- Conan version: conan 1.47.0
- Python version: Python 3.8.10
Steps to reproduce (Include if Applicable)
- create a dummy conanfile.py for wrapping a static library, e.g. to wrap
/usr/lib/x86_64-linux-gnu/libcrypto.a
, use this package_info method:
def package_info(self):
self.cpp_info.libdirs = ["/usr/lib/x86_64-linux-gnu"]
self.cpp_info.libs = ["libcrypto.a"]
- have a second recipe that consumes the dummy recipe and builds a executable or library with autotools. Excerpts from such a conanfile.py:
from conans import ConanFile, AutoToolsBuildEnvironment
[...]
def build(self)
[...]
autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
configure_args = [...]
autotools.configure(vars=self._autotools_vars, args=configure_args)
[...]
Actual behaviour
autotools / configure is called with environment variable
LIBS=-llibcrypto.a
Expected behaviour
autotools / configure is called with environment variable
LIBS=-l:libcrypto.a
References:
- see https://stackoverflow.com/questions/6578484/telling-gcc-directly-to-link-a-library-statically
- and https://sourceware.org/binutils/docs/ld/Options.html
-l namespec: [...] If namespec is of the form :filename, ld will search the library path for a file called filename, otherwise it will search the library path for a file called libnamespec.a [or _libnamespec.so].
Logs (Executed commands with output) (Include/Attach if Applicable)
I found the relevant python methods to be these: