On Jan 11, 2019, at 14:12, Christoph Kukulies wrote:
> I have a downloaded a library (open source) - libartnet to be more precise.
> It’s a typical UNIX package with configure and Makefile. It compiled smoothly
> (./configure ; make ) as I tried out on macOS mojave x64 architecture.
>
> I would like to port this to the iPhone architecture. How could I achieve
> this? Is there a way to cross compile it under macOS?
>
> How does one import such large packages to Xcode. Pointers or links welcome
> as well.
You're right, the question is off-topic here, since MacPorts is for installing
software on macOS; MacPorts has no support for cross-compiling for iOS. The
Stack Overflow web site or Apple developer forums are better places to ask such
a question.
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.
When building within Xcode, I think you'll want to add custom script steps that
invoke configure, make, make install, supplying those environment variables at
the right places. Xcode sets some of its own variables that are available to
those scripts; you can use those variables to get the archs and SDK paths that
were configured into the Xcode project.