[Rpm-maint] [PATCH] fix building outside srcdir

Roland McGrath roland at redhat.com
Wed May 27 00:52:20 UTC 2009


I found this necessary to build rpm from the development sources using:

	$ git clone git://rpm.org/rpm.git
	$ cd rpm
	$ ./autogen.sh --noconfigure
	$ mkdir -p ../build/rpm
	$ cd ../build/rpm
	$ ../rpm/configure [...]


Thanks,
Roland


diff --git a/lib/Makefile.am b/lib/Makefile.am
index cd01d27..0000000 100644  
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,7 +2,8 @@
 
 include $(top_srcdir)/rpm.am
 
-AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
+AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/ \
+	      -I$(builddir)
 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += @WITH_SQLITE3_INCLUDE@
@@ -57,7 +58,9 @@ librpm_la_LIBADD += @WITH_DB_LIB@
 endif
 
 tagtbl.c: Makefile.am $(top_srcdir)/lib/rpmtag.h gentagtbl.sh
-	@AWK=${AWK} ${SHELL} gentagtbl.sh $(top_srcdir)/lib/rpmtag.h > $@
+	@AWK=${AWK} ${SHELL} $(srcdir)/gentagtbl.sh \
+		    	     $(top_srcdir)/lib/rpmtag.h > $@.new && \
+	 mv -f $@.new $@
 BUILT_SOURCES = tagtbl.c
 
 if WITH_INTERNAL_DB


More information about the Rpm-maint mailing list