def generate(self): td = AutotoolsDeps(self) # remove non-existing frameworks dirs, otherwise clang complains for m in re.finditer("-F (\S+)", td.vars().get("LDFLAGS")): if not os.path.exists(m[1]): td.environment.remove("LDFLAGS", f"-F {m[1]}") if self.settings.os == "Windows": if self._is_msvc: td.environment.append("LIBS", [f"{lib}.lib" for lib in self._windows_system_libs]) else: td.environment.append("LDFLAGS", [f"-l{lib}" for lib in self._windows_system_libs]) td.generate() tc = AutotoolsToolchain(self) tc.default_configure_install_args = True tc.configure_args = ["--disable-install-doc"] if self.options.shared and not self._is_msvc: tc.configure_args.append("--enable-shared") tc.fpic = True if cross_building(self) and is_apple_os(self.settings.os): apple_arch = to_apple_arch(self.settings.arch) if apple_arch: tc.configure_args.append(f"--with-arch={apple_arch}") if self._is_msvc: # this is marked as TODO in https://github.com/conan-io/conan/blob/01f4aecbfe1a49f71f00af8f1b96b9f0174c3aad/conan/tools/gnu/autotoolstoolchain.py#L23 tc.build_type_flags.append(f"-{msvc_runtime_flag(self)}") # https://github.com/conan-io/conan/issues/10338 # remove after conan 1.45 if self.settings.build_type in ["Debug", "RelWithDebInfo"]: tc.ldflags.append("-debug") tc.build_type_flags = [f if f != "-O2" else self._msvc_optflag for f in tc.build_type_flags] tc.generate()
def generate(self): ad = AutotoolsDeps(self) # this can be removed if conan >= 1.44.0 due to https://github.com/conan-io/conan/pull/10192 for m in re.finditer("-Wl,-rpath,\"[^\"]+\"", ad.vars()["LDFLAGS"]): ad.environment.remove("LDFLAGS", m[0]) ad.generate() ac = AutotoolsToolchain(self) ac.default_configure_install_args = True ac.configure_args.extend( ["--with-system-zlib", "--with-system-readline"]) ac.generate()
def generate(self): yes_no = lambda v: "yes" if v else "no" tc = AutotoolsToolchain(self) tc.default_configure_install_args = True # FIXME: https://github.com/conan-io/conan/issues/10650 (should be default) tc.configure_args.append("--with-zstd=%s" % yes_no(self.options.with_zstd)) tc.configure_args.append("--with-xz=%s" % yes_no(self.options.with_xz)) tc.configure_args.append("--with-zlib=%s" % yes_no(self.options.with_zlib)) tc.configure_args.append("--with-openssl=%s" % yes_no(self.options.with_openssl)) tc.configure_args.append("--enable-experimental=%s" % yes_no(self.options.experimental)) tc.configure_args.append("--enable-logging=%s" % yes_no(self.options.logging)) tc.configure_args.append("--enable-debug=%s" % yes_no(self.settings.build_type == "Debug")) tc.configure_args.append("--enable-tools=no") tc.configure_args.append("--enable-manpages=no") tc.configure_args.append("--enable-test-modules=no") tc.configure_args.append("--enable-python=no") tc.configure_args.append("--enable-coverage=no") tc.generate() tc = PkgConfigDeps(self) tc.generate() tc = AutotoolsDeps(self) tc.environment.define( "PKG_CONFIG_PATH", self.source_folder ) # FIXME: https://github.com/conan-io/conan/issues/10639 (should work out of the box) tc.environment.define( "LIBS", "-lpthread" ) # FIXME: https://github.com/conan-io/conan/issues/10341 (regression in 1.45, soname arguments are "eaten") tc.environment.define( "libzstd_LIBS", "-lzstd" ) # FIXME: https://github.com/conan-io/conan/issues/10640 (zstd pkg-config includes itself) tc.environment.define( "zlib_LIBS", "-lz" ) # FIXME: https://github.com/conan-io/conan/issues/10651 (command line is polluted by framework arguments) tc.environment.define("libcrypto_LIBS", "-lcrypto -ldl -lrt -lpthread") tc.environment.define("liblzma_LIBS", "-llzma") tc.generate()
def generate(self): tc = AutotoolsToolchain(self) tc.default_configure_install_args = True tc.generate()