I've started using Conan to manage a cross platform project with a fairly large dependency tree (diving into the deep end, I know). Several components in the project use autotools for their configuration step, and I'm struggling to get some of those scripts to detect it properly. Conan itself offers little guidance on the subject, so I'm certain there's some setting I'm missing.
To test out my cross environment, I'm compiling libcurl/7.69.1 from MacOS to iOS armv8 with the following settings (using --build to make everything locally):
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=11.0
os=iOS
os.version=9.0
os_build=Macos
[options]
darwin_ssl=False
with_openssl=True
[build_requires]
*: darwin-toolchain/1.0.6@theodelrieu/stable
libcurl/*: libtool/2.4.6
[env]
When it gets to the libcurl configure script, it fails with the following message (relevant libtool output included):
libtool/2.4.6: Package '150f8c59c5beb38d3bb23c3061298c1594abbc17' created
libtool/2.4.6: Created package revision 33a24903417fc5c368223b78e4ffc784
libtool/2.4.6: Appending PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin
libtool/2.4.6: Setting LIBTOOLIZE env to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/libtoolize
libtool/2.4.6: Appending ACLOCAL_PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Setting LIBTOOL_PREFIX environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17
libtool/2.4.6: Setting LIBTOOL_DATADIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share
libtool/2.4.6: Setting LIBTOOL_PKGAUXDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool/build-aux
libtool/2.4.6: Setting LIBTOOL_PKGLTDLDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool
libtool/2.4.6: Setting LIBTOOL_ACLOCALDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Appending AUTOMAKE_CONAN_INCLUDES environment variable: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
...
libcurl/7.69.1: Calling:
> ./configure '--without-libidn2' '--without-librtmp' '--without-libmetalink' '--without-libpsl' '--without-brotli' '--with-ssl=/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78' '--without-libssh2' '--without-nghttp2' '--with-zlib=/Users/my_home_dir/.conan/data/zlib/1.2.11/_/_/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib' '--disable-shared' '--enable-static' '--disable-ldap' '--enable-threaded-resolver' '--disable-verbose' '--prefix=/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/package/614a97ea5d3c0afeea50678bf1a8f62835834ff0' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' --build=x86_64-apple-darwin --host=aarch64-apple-darwin
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable ESNI support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for aarch64-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/build/614a97ea5d3c0afeea50678bf1a8f62835834ff0/source_subfolder':
configure: error: C compiler cannot create executables
See `config.log' for more details
And the libcurl config.log reads:
configure:4319: checking whether the C compiler works
configure:4341: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -arch arm64 -mios-version-min=9.0 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -L/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib conftest.c -lltdl -lssl -lcrypto -lz >&5
ld: library not found for -lltdl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4345: $? = 1
configure:4383: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "curl"
| #define PACKAGE_TARNAME "curl"
| #define PACKAGE_VERSION "-"
| #define PACKAGE_STRING "curl -"
| #define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.haxx.se/mail/"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int main (void)
| {
|
| ;
| return 0;
| }
My main question: Searching around, this error seems to indicate libtool cannot be found for my target platform. Am I setting up my autotools correctly within my profile? I copied it from the linux settings within lib curl's recipe; are there any other settings needed to get it set up for a MacOS build agent?
Some other misc questions to help me understand what I'm doing:
- When I declare a build_requirement, those components get compiled for the build architecture, correct? (MacOS/x86_64 in this case)
- The libcurl recipe on conan-center-index does not set libtool as a build_requirement for MacOS, but configure still tries to call it. Is that an oversight within the recipe or is there supposed to be another way to compile libcurl on MacOS machines?
- I noticed the libtool package appends LIBTOOL_PREFIX/bin to the PATH, but libltdl.a resides in LIBTOOL_PREFIX/lib, does the curl configure script find libltdl.a some other way?