-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot cross compile to Haiku with CMake #10296
Comments
I would probably suggest you try using configure instead, which is a more mature build for curl. |
When cross-compiling for Haiku, the networking library needs to be brought in. Without this, an unknown type of "Error" is reported in lib/curl_setup_once.h. This is also needed when using CMake natively on Haiku to build libcurl. Fixes curl#10296
I decided to take a look at this and fix the bug real quick. 😃 You'll need to make sure that you add -DCMAKE_SYSTEM_NAME=Haiku to your CMake line, but after this commit it should build properly. I decided to install Haiku in a VM as well and installed CMake from HaikuDepot. I discovered that running CMake on the cURL sources on Haiku will result in the same problem, so I applied my change there and it builds using your command as well (though with -DCMAKE_C_COMPILER=gcc-x86 because the default gcc is 2.95.3, which pretty much causes the build to fail immediately). Just for fun, I decided to build curl using configure on Haiku as well, and the only thing special that I had to do was set CC=gcc-x86. On Haiku, gcc-x86 is GCC 11.2.0, while 'gcc' is 2.95.3. |
For users building cURL on Haiku using CMake, I suggest:
This results in a successful compilation of libcurl and the 'curl' command line utility for me |
When cross-compiling for Haiku, the networking library needs to be brought in. Without this, an unknown type of "Error" is reported in lib/curl_setup_once.h. This is also needed when using CMake natively on Haiku to build libcurl. Fixes curl#10296 Closes curl#10792
I did this
I'm porting a personal CMake project which uses curl to Haiku OS, however libcurl build is failing with the following output:
Here is the complete output log of
cmake ./
:Looking at these logs I see curl was not able to find any socket-related function:
But they are all properly defined in the
sys/socket.h
header:After a bit of research I found out Haiku requires all socket programs to link against
-lnetwork
(source).So I changed the C compiler command invocation from:
to
And the build went just fine.
Here is the cross compiler I used, just in case someone want to reproduce this issue.
I expected the following
Libcurl builds successful.
curl/libcurl version
Latest master.
operating system
The text was updated successfully, but these errors were encountered: