I have a situation where our software needs to work with several different Linux kernel distributions / kernel trees. (including Android forks)
In trying to automate
The kernel has a tool (./scripts/config) to change specific options on .config. Here is an example:
./scripts/config --set-val CONFIG_OPTION y
Although, it doesn't check the validity of the .config file.