jasonacox / Build-OpenSSL-cURL

Scripts to build OpenSSL, HTTP/2 (nghttp2) and cURL (libcurl) for MacOS, iOS and tvOS devices (x86_64, armv7, armv7s, arm64, arm64e). Now Supporting Apple Silicon, OpenSSL 3.0.x with TLS 1.3 and Mac Catalyst builds.
MIT License
430 stars 129 forks source link

Apple Silicon #47

Closed KatkayApps closed 3 years ago

KatkayApps commented 3 years ago

Can you please update your amazing script to compile for Apple Silicon? Thanks

jasonacox commented 3 years ago

Hi @KatkayApps - Great question. I'm in the process of doing that now. I am using the Apple Developer Transition Kit (DTK based on Apple’s A12Z Bionic System) and currently having some problems getting iOS simulator targets built for the arm64 architecture. I have it successfully building for the arm64, and all other targets, just not for the iOS simulator. If you or anyone else has figured it out, I would love to hear it!

Note: If you want to try it - there is an applesilicon branch here: https://github.com/jasonacox/Build-OpenSSL-cURL/tree/applesilicon

KatkayApps commented 3 years ago

Hi, unfortunately I am clueless on that matter. I wish I could understand this theme deeply.

fnuky commented 3 years ago

Ok, If I build apple silicone arch, how to use binary in project? Isn't it better to make option to build as framework and then make from frameworks XFRamework?

jasonacox commented 3 years ago

Yes, that is the plan. I just haven't had time to work on it.

fnuky commented 3 years ago

Great, If I could help you, please let me know

jasonacox commented 3 years ago

Thanks! I would love the help. I have it successfully building for the arm64, and all other targets, but I cannot get everything to build for the iOS simulator on an arm64 host (apple silicon).

As to frameworks, if you have want to fork the current master and add that function, submit a pull request and I'll merge it back in.

jasonacox commented 3 years ago

@KatkayApps the script now builds for Apple Silicon and on Apple Silicon. Give it a try and let me know if you have suggestions.

@fnuky I still need to have it auto-build the framework binaries. Any suggestion would be helpful. I'll do research when I have time.

mofarajmandi commented 3 years ago

@jasonacox so regarding auto-building Framework, I would recommend moving to newly introduced packaging XCFrameworks, which supports multiple platforms (iOS, tvOS, etc) all in single "archive" where it can be easily consumed by Xcode and devs wouldn't need to deal with extra (lipo) scripts to add or remove architecture slices on the fly. Here is an example script, which adds creation of XCFrameworks for all libcurl dependencies but only for iOS. https://github.com/mofarajmandi/Build-OpenSSL-cURL/commit/7e6be78f3aaab8f9cfc966743fa52379b009009a

I realized that for tvOS you are not creating simulator slices in the same way you did for iOS (i.e. adding support for arm64 Mac aka Apple Silicon) curious if there were issues, or you just didn't get to updating tvOS scripts?

jasonacox commented 3 years ago

Thank you! XCFrameworks is on my list. Thanks for the example! Feel free to submit a PR.

Yes, I just ran out of time with tvOS. I expect it shouldn't be too difficult I just need to finish it and get it tested.

mofarajmandi commented 3 years ago

@jasonacox Thank you for putting this repo together. Here is the PR: https://github.com/jasonacox/Build-OpenSSL-cURL/pull/51

jasonacox commented 3 years ago

@mofarajmandi Thank you for the PR! I've added you to the credits. Closing this issue.