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.
xmame/xmess should be distributed under terms of the license in doc/readme.mame
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 Marmnez). Use it under terms of GNU General Public License