Yes, the build configuration sets all the build options/etc.
So you can have two builds, with:
- Develop, this one has the define set with option -D, for example BUILD_FOR_PRODUCTION=0

- Production, this one has set BUILD_FOR_PRODUCTION=1
Then in your startup file you have this:
__attribute__ ((used,section(".FlashConfig"))) const struct {
unsigned int word1;
unsigned int word2;
unsigned int word3;
unsigned int word4;
} Flash_Config =
#if BUILD_FOR_PRODUCTION==1
{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, whatever you put here }; /* flash security enabled */
#else /* debug/develop */
{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE};
#endif
That way you have the full flexibility, and you can use that macro in other places too (e.g. for extra logging, etc).
I hope this helps,
Erich