Thanks for the Xcode env below. I solved it straight forward by copying the 
handful of C programs and header files into my Xcode project 
and let Xcode compile them. Though I didn’t get a dynamic library that way, I’m 
able to incorporate it into the app.

What the consequences for LGPL use are is another story. Don’t know yet. Don’t 
know how to distribute iPhone Apps together with LGPL libs anyway yet.


And excuses for being OT again.

—
Christoph


> Am 12.01.2019 um 00:05 schrieb Andrew Udvare <[email protected]>:
> 
> 
> 
>> On 2019-01-11, at 16:27, Ryan Schmidt <[email protected]> wrote:
>> 
>> To cross-compile for iOS, you would presumably need to tell the build system 
>> what architecture(s) to build for and what SDK to use. Often, that can be 
>> done by adding the right -arch flags to the CFLAGS, CXXFLAGS, OBJCFLAGS, 
>> OBJCXXFLAGS, and LDFLAGS environment variables, and adding the right 
>> -syslibroot flag (pointing to the iOS SDK you want to use) to the CFLAGS, 
>> CXXFLAGS, OBJCFLAGS, and OBJCXXFLAGS variables, and adding the right 
>> -Wl,-syslibroot, flag (pointing to the right iOS SDK) to the LDFLAGS.
> 
> On current macOS and Xcode, this is done like so:
> 
> env CC=clang CFLAGS='-isysroot 
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk
>  -target arm-apple-darwin -arch arm64' ./configure 
> --build=x86_64-apple-darwin --host=arm-apple-darwin
> make
> 
> You'll see the dylib file has aarch64 architecture:
> 
> $ file ./artnet/.libs/libartnet.1.dylib
> ./artnet/.libs/libartnet.1.dylib: Mach-O 64-bit arm64 dynamically linked 
> shared library, flags:<|DYLDLINK|NO_REEXPORTED_DYLIBS>
> 
> But this only builds a library (dylib) and on iOS you don't directly load 
> libraries. With the given output from libarinet, if you want it as a separate 
> library, you have to make a framework and bundle that with your app (allowed 
> since iOS 8).
> 
> Any binaries compiled this way will only work on a jailbroken due to lack of 
> code signing.
> 
> --
> Andrew

Reply via email to