Fix rpcgen post-processing for out-of-tree builds
[libguestfs.git] / src / Makefile.am
index a5d7322..28a1b92 100644 (file)
@@ -13,7 +13,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include $(top_srcdir)/subdir-rules.mk
 
@@ -165,13 +165,13 @@ libguestfs_la_CFLAGS = \
   $(LIBVIRT_CFLAGS) $(LIBXML2_CFLAGS) \
   $(WARN_CFLAGS) $(WERROR_CFLAGS)
 
-libguestfs_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib
+libguestfs_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
 
 if HAVE_RPCGEN
 guestfs_protocol.c: guestfs_protocol.x
        rm -f $@-t $@-t2
        $(RPCGEN) -c -o $@-t $(srcdir)/$<
-       sed 's,\.\./\.\./src/,,' < $@-t > $@-t2
+       sed 's,\.\./\(\.\./\)*src,.,' < $@-t > $@-t2
        rm $@-t
        mv $@-t2 $@