Do not build apple objective-c codes if using gcc

This fixes bug #3546