I want my project to run on all iPhone devices with iOS version 4.0 or higher. But the .ipa shouldn’t get installed on a device with iOS version lower than 4.0. Which base SDK should I use, what should be the deployment target and should I make 2 different builds, one for iOS 4.x and another for iOS 5.x?
The project is built using 4.2 as base SDK.
The base SDK is always the set of tools that you use to compile your app and thus the maximum amount of features that you can use. You can safely set this to 5.0. The deployment target on the other hand decides which is the minimum version that can run your app. You would set this to 4.0 in your example. Be aware though that you need to take care not to use any features from iOS 4.1 onwards unconditionally.
There are several methods to check for the availability of classes, methods and APIs in general that allow you to use iOS 5 features on devices that support it while falling back to iOS 4 APIs where needed.