Problem is that solution does not work on all systems; libtool will use a different compiler command line than $(CXXCOMPILE), so when using libtool on some systems you wind up with not being able to use the precompiled header.
I have not yet found a way to work around this; I tried to use $(LTCXXCOMPILE), but it complains that it does not know how to deal with a header file (saying libtool: compile: cannot determine name of library object from 'project.hxx'
). Of course, what it should do is use project.hxx.gch
as the output file, but I don't see a way to make it do that short of modifying the libtool script, and that would defeat the purpose of using the GNU build system…