Shazron, hehe I'm not that smart I took the variable from the debug script.
By adding this variable CONFIGURATION_BUILD_DIR actually I'm fixing two problems.
Problem #1: Compile Error
Since Header Search Path already contains the build $(BUILT_PRODUCTS_DIR) and this match $(CONFIGURATION_BUILD_DIR) then the compiler will know where to find the include files to compile
Problem #2: Building a good IPA containing the cordovalib linked with compiled library
I tried fixing the header search path to make the compile work from command line this produced an ipa that was not usable, the final output didnt' contain the cordovalib compiled.
The key thing is that the cordovalib output needs to be found by archive process to put everything inside the ipa
This is why I took the shortcut of just adding the $(CONFIGURATION_BUILD_DIR) to fix both problems.
I hope this helps clarify.
I took me a while to figured out when I upgraded from cordova 1.6.1 to 2.0.0 and suddenly I was not getting a good IPA to be install on phone for ad-hoc/enterprise distribution over webpage.