Please read the MAME/MESS readme-files first!
Xmame/xmess should be distributed under terms of the license in readme.mame
And if you are interested in MESS, take a look in readme.mess
The main issue involves ROM images. ROM images are protected under the copyrights of their authors, and CANNOT be distributed in the same package as xmame/xmess. Download any ROM images at your own risk and responsibility.
XInputExtensions-based Joystick support. Source code is entirely pure hack work. No sample code, no info at all was found (only library reference manual) and is copyrighted by me (Juan Antonio Martinez). Use it under terms of GNU General Public License.