Friday, November 18, 2011

Improved Git development model

If you are just starting to utilize Git in your team I would highly recommend to take a look at the git-flow https://github.com/nvie/gitflow and read the following article:
http://nvie.com/posts/a-successful-git-branching-model/

Enjoy!

Thursday, November 17, 2011

More fun with Android NDK7

I tried to compile cURL library Android NDK7 for x86 architecture and it looks like though the bug was reported in NDK6b: http://code.google.com/p/android/issues/detail?id=19851, the libc is still missing few functions sigsetjmp and siglongjmp.
The easiest solution for me was to get the libc from the latest ICS source tree (built for x86 arch).
Looking forward to get this fixed in NDK8, hopefully before Christmas.


if you are using sem_timedwait on iOS or Mac OS X ....

While porting some C/C++ code to iOS found out that sem_timedwait is not implemented on iOS or Mac OS X and seems like on many BSD systems. Here is the discussion on the topic:
http://stackoverflow.com/questions/641126/posix-semaphores-on-mac-os-x-sem-timedwait-alternative
The discussion a bit old but it seems like it is still a valid one.

For now I conditionally compiled the code with the call sem_wait, will look into a better cross-platform solution later.

Wednesday, November 16, 2011

Native libraries porting to iOS

Recently I spent a bit of time working on porting (getting built) some native libraries with Android NDK and iOS. The port to Android NDK deserves it's own post, that I might write down later.

As for iOS, I primarily needed openssl, curl, zlib and found nice little script, that helps you with the build:
http://code.google.com/p/ios-static-libraries. Just comment out what you don't need and you should be good to go. It's quite easy to repurpose the script to pull the source from your local repos if needed.

One of the problem I had was that I have only iOS SDK 5.0 on the machine and the libcurl build for iPhone device was breaking because "cpp" compiler (export CXXCPP=${DEVROOT}/usr/bin/cpp
) was not found . Apple provided "cpp" compiler for the emulator, but conveniently left it out from the iPhone device toolchain. The easy fix for that is to create the symbolic link in the /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin directory:
ln -s llvm-cpp-4.2 cpp

Hope this saves you a bit of time.