If you want it to be compatible with both Xilinx or altera, you only have 2 options:
1. Use inference. ie. do not use the megawizard or core-gen AT all, and do not use altsyncram. You cannot use the altera_MF library. Read how to infer rams for altera here:
http://www.altera.co.uk/literature/hb/qts/qts_qii51007.pdf And Xilinx Here:
http://www.xilinx.com/support/documentation/white_papers/wp231.pdf Compile your code in both to ensure the same type of memory is inferred.
2. Use a wrapper around a core-gen or megawizard altsyncram, that can chose which one to use based on a generic. You need to be careful they behave the same by doing a good load of simulations.
You cannot make altsyncram compatible with Xilinx - it's an altera component.