THRIFT-2912 Autotool build for C++ Qt library is invalid
Client: C++
Patch: Nobuaki Sukegawa <nsukeg@gmail.com>

This closes #336

* Fix incorrect AC_PATH_PROGS usage
* Exclude generated source code from distribution
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index c95b43d..e6a6015 100755
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -114,16 +114,16 @@
 libthriftz_la_SOURCES = src/thrift/transport/TZlibTransport.cpp
 
 libthriftqt_la_MOC = src/thrift/qt/moc_TQTcpServer.cpp
-libthriftqt_la_SOURCES = $(libthriftqt_la_MOC) \
-                         src/thrift/qt/TQIODeviceTransport.cpp \
+nodist_libthriftqt_la_SOURCES = $(libthriftqt_la_MOC)
+libthriftqt_la_SOURCES = src/thrift/qt/TQIODeviceTransport.cpp \
                          src/thrift/qt/TQTcpServer.cpp
 CLEANFILES = $(libthriftqt_la_MOC)
 
 libthriftqt5_la_MOC = src/thrift/qt/moc__TQTcpServer.cpp
-libthriftqt5_la_SOURCES = $(libthriftqt5_la_MOC) \
-                         src/thrift/qt/TQIODeviceTransport.cpp \
-                         src/thrift/qt/TQTcpServer.cpp
-CLEANFILES = $(libthriftqt5_la_MOC)
+nodist_libthriftqt5_la_SOURCES = $(libthriftqt5_la_MOC)
+libthriftqt5_la_SOURCES = src/thrift/qt/TQIODeviceTransport.cpp \
+                          src/thrift/qt/TQTcpServer.cpp
+CLEANFILES += $(libthriftqt5_la_MOC)
 
 # Flags for the various libraries
 libthriftnb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEVENT_CPPFLAGS)