Use GNU autotools as in e.g. https://github.com/bengtmartensson/java-readline Pack a fallback version of media/lirc.h for the case that the system's is not found.