Skip to content

Commit

Permalink
(#4457) [libcurl] update usage of tools.apple_deployment_target_flag
Browse files Browse the repository at this point in the history
* - [libcurl] update usage of tools.apple_deployment_target_flag

Signed-off-by: SSE4 <[email protected]>

* libcurl: Update Conan conventions

Automatically created by bincrafters-conventions 0.30.2

* - remove iOS-specific code, AutoToolsBuildEnvironment already handles sysroot, arch and min version

Signed-off-by: SSE4 <[email protected]>

* - use autoreconf instead of buildconf

Signed-off-by: SSE4 <[email protected]>

* - use rootpath everywhere instead of lib_paths[0]

Signed-off-by: SSE4 <[email protected]>

* Update recipes/libcurl/all/conanfile.py

Co-authored-by: SpaceIm <[email protected]>

* Update recipes/libcurl/all/conanfile.py

Co-authored-by: bincrafters-user <[email protected]>
Co-authored-by: SpaceIm <[email protected]>
  • Loading branch information
3 people authored Feb 12, 2021
1 parent dc21ddb commit 0239862
Showing 1 changed file with 7 additions and 58 deletions.
65 changes: 7 additions & 58 deletions recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def build_requirements(self):
tools.os_info.detect_windows_subsystem() != "msys2":
self.build_requires("msys2/20200517")
elif self._is_win_x_android:
self.build_requires("ninja/1.10.1")
self.build_requires("ninja/1.10.2")
elif not tools.os_info.is_windows:
self.build_requires("libtool/2.4.6")
self.build_requires("pkgconf/1.7.3")
Expand Down Expand Up @@ -249,7 +249,7 @@ def _get_configure_command_args(self):
params.append("--without-wolfssl")

if self.options.with_libssh2:
params.append("--with-libssh2={}".format(tools.unix_path(self.deps_cpp_info["libssh2"].lib_paths[0])))
params.append("--with-libssh2={}".format(tools.unix_path(self.deps_cpp_info["libssh2"].rootpath)))
else:
params.append("--without-libssh2")

Expand All @@ -259,7 +259,7 @@ def _get_configure_command_args(self):
params.append("--without-nghttp2")

if self.options.with_zlib:
params.append("--with-zlib={}".format(tools.unix_path(self.deps_cpp_info["zlib"].lib_paths[0])))
params.append("--with-zlib={}".format(tools.unix_path(self.deps_cpp_info["zlib"].rootpath)))
else:
params.append("--without-zlib")

Expand Down Expand Up @@ -347,7 +347,7 @@ def _patch_mingw_files(self):
def _build_with_autotools(self):
with tools.chdir(self._source_subfolder):
# autoreconf
self.run("./buildconf", win_bash=tools.os_info.is_windows, run_environment=True)
self.run("{} -fiv".format(tools.get_env("AUTORECONF") or "autoreconf"), win_bash=tools.os_info.is_windows, run_environment=True)

# fix generated autotools files on alle to have relocateable binaries
if tools.is_apple_os(self.settings.os):
Expand Down Expand Up @@ -375,60 +375,6 @@ def _configure_autotools_vars(self):
del autotools_vars["LIBS"]
self.output.info("Autotools env vars: " + repr(autotools_vars))

if tools.cross_building(self.settings):
if self.settings.os == "iOS":
iphoneos = tools.apple_sdk_name(self.settings)
ios_dev_target = str(self.settings.os.version).split(".")[0]

env_cppflags = tools.get_env("CPPFLAGS", "")
socket_flags = " -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK"
if self.settings.arch in ["x86", "x86_64"]:
autotools_vars["CPPFLAGS"] = "-D__IPHONE_OS_VERSION_MIN_REQUIRED={}0000 {} {}".format(
ios_dev_target, socket_flags , env_cppflags)
elif self.settings.arch in ["armv7", "armv7s", "armv8"]:
autotools_vars["CPPFLAGS"] = "{} {}".format(socket_flags, env_cppflags)
else:
raise ConanInvalidConfiguration("Unsuported iOS arch {}".format(self.settings.arch))

cc = tools.XCRun(self.settings, iphoneos).cc
sysroot = "-isysroot {}".format(tools.XCRun(self.settings, iphoneos).sdk_path)

if self.settings.arch == "armv8":
configure_arch = "arm64"
configure_host = "arm" #unused, autodetected
else:
configure_arch = self.settings.arch
configure_host = self.settings.arch #unused, autodetected


arch_flag = "-arch {}".format(configure_arch)
ios_min_version = tools.apple_deployment_target_flag(self.settings.os, self.settings.os.version)
extra_flag = "-Werror=partial-availability"

# if we debug, maybe add a -gdwarf-2 , but why would we want that?

autotools_vars["CC"] = cc
autotools_vars["IPHONEOS_DEPLOYMENT_TARGET"] = ios_dev_target
env_cflags = tools.get_env("CFLAGS", "")
autotools_vars["CFLAGS"] = "{} {} {} {}".format(
sysroot, arch_flag, ios_min_version, env_cflags
)

if self.options.with_ssl == "openssl":
openssl_path = self.deps_cpp_info["openssl"].rootpath
openssl_libdir = self.deps_cpp_info["openssl"].libdirs[0]
autotools_vars["LDFLAGS"] = "{} {} -L{}/{}".format(arch_flag, sysroot, openssl_path, openssl_libdir)
elif self.options.with_ssl == "wolfssl":
wolfssl_path = self.deps_cpp_info["wolfssl"].rootpath
wolfssl_libdir = self.deps_cpp_info["wolfssl"].libdirs[0]
autotools_vars["LDFLAGS"] = "{} {} -L{}/{}".format(arch_flag, sysroot, wolfssl_path, wolfssl_libdir)
else:
autotools_vars["LDFLAGS"] = "{} {}".format(arch_flag, sysroot)

elif self.settings.os == "Android":
# nothing do to at the moment, this seems to just work
pass

return autotools_vars

def _configure_autotools(self):
Expand All @@ -449,6 +395,9 @@ def _configure_autotools(self):

self._autotools.defines.append("_AMD64_")

if tools.cross_building(self) and tools.is_apple_os(self.settings.os):
self._autotools.defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK'])

configure_args = self._get_configure_command_args()

if self.settings.os == "iOS" and self.settings.arch == "x86_64":
Expand Down

0 comments on commit 0239862

Please sign in to comment.