[ldns-users] ldns on iPhone ?

Henri Asseily henri at asseily.com
Wed May 2 04:21:03 UTC 2012


>> even just briefly outline what you did ?
> I downloaded the script for creating the OpenSLL library made by Felix Schutze:
> http://www.x2on.de/2010/12/16/tutorial-script-for-building-openssl-for-ios-iphoneipad/
> (He has made a new one. Everything broke 'cause of the XCode update as an Mac App Store app).
> 
> The technique involved here, is creating static, Universal libraries you can add to your XCode project.
> Not creating a Framework like Henri Asseily did. I thought this was smarter, but I am not sure.

The difference between a shared lib and a framework is simply one of bundling. The framework is a directory structure comprising all the necessary libraries and their header files that can be simply dropped into a project in XCode in a single step.
Felix Schutze determined that there was not only an additional parameter to send to configure (BSD-generic32, which can be passed into my generic script on the command line), but also that OpenSSL source code needs the below modifications for iOS (slightly different for each build of sim, armv6 or armv7):

sed -ie "s!^CFLAG=!CFLAG=-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk !" "Makefile"
# remove sig_atomic for iPhoneOS
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"

I can add that to my script and make a complete OpenSSL framework if you're interested.

> 
> For creating the libunbound, the same technique is needed, but you have to iterate because of the
> dependencies Unbound has with ldns. Three build runs were needed to create libunbound (with ldns)
> for the architectures needed for iOS devices (i386, armv6, armv7). Scripts can be found at SIDN labs
> as soon as the article on libunbound gets published. (Though the script is broken because of the
> XCode update. I must fix this, but I'm no hard-core programmer).

Let me know if you need help. We could pretty much package the whole thing (OpenSSL + libunbound + ldns) into one drop-in framework.



More information about the ldns-users mailing list