make dist does not work in VPATH
Hi,
It seems we're neglecting to copy GNUmakefile into the temporary
distdir:
$ pwd
/pgsql/build/83_rel
$ make dist
rm -rf postgresql-8.3.3* =install=
for x in `cd /pgsql/source/83_rel && find . -name CVS -prune -o -print`; do \
file=`expr X$x : 'X\./\(.*\)'`; \
if test -d "/pgsql/source/83_rel/$file" ; then \
mkdir "postgresql-8.3.3/$file" && chmod 777 "postgresql-8.3.3/$file"; \
else \
ln "/pgsql/source/83_rel/$file" "postgresql-8.3.3/$file" >/dev/null 2>&1 \
|| cp "/pgsql/source/83_rel/$file" "postgresql-8.3.3/$file"; \
fi || exit; \
done
make -C postgresql-8.3.3 distprep
make[1]: entrant dans le r�pertoire � /home/alvherre/Code/CVS/pgsql/build/83_rel/postgresql-8.3.3 �
make[1]: *** Pas de r�gle pour fabriquer la cible � distprep �. Arr�t.
make[1]: quittant le r�pertoire � /home/alvherre/Code/CVS/pgsql/build/83_rel/postgresql-8.3.3 �
make: *** [distdir] Erreur 2
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Is it sensible for make dist to work in a VPATH? Seems like the entire
point of that operation is to modify the source tree.
regards, tom lane
Tom Lane wrote:
Is it sensible for make dist to work in a VPATH? Seems like the entire
point of that operation is to modify the source tree.
Actually the point AFAICS is to generate a tarball. Why wouldn't it
work in a VPATH build?
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Alvaro Herrera wrote:
It seems we're neglecting to copy GNUmakefile into the temporary
distdir:
make -C postgresql-8.3.3 distprep
make[1]: entrant dans le r�pertoire �
/home/alvherre/Code/CVS/pgsql/build/83_rel/postgresql-8.3.3 � make[1]: ***
Pas de r�gle pour fabriquer la cible � distprep �. Arr�t. make[1]: quittant
le r�pertoire � /home/alvherre/Code/CVS/pgsql/build/83_rel/postgresql-8.3.3
� make: *** [distdir] Erreur 2
Hmm. When you do an in-tree build, the distdir copy contains a configured
source tree. When you do an out-of-tree build, the distdir copy only the
bare source tree, because the configure output files are in the build tree,
which is not copied.
Fix option 1 would be to copy the build tree as well, if it is different from
the source tree. Since the build tree contains a bunch of symlinks back to
the source tree, this would probably need some careful file handling to not
overwrite the real files with symlinks or something like that.
Fix option 2 is to rerun configure before make distprep.
Peter Eisentraut wrote:
Fix option 1 would be to copy the build tree as well, if it is different from
the source tree. Since the build tree contains a bunch of symlinks back to
the source tree, this would probably need some careful file handling to not
overwrite the real files with symlinks or something like that.
Thanks, this seems to do the trick. The only thing I'm missing here is
how to implement the "is the build dir different from the source dir".
Any ideas?
It is a shame that one needs to copy all the .o, .Po, etc files and then
remove them with "make distclean". It would be possible to skip linking
them by having an exception in the "find" line, but I'm not sure if that
works portably enough (i.e. is the extension common across all archs?)
Note that I skip directories not already existing in distdir. This is
so that the .deps directories are not included in the tarball, which
would be dumb. Also, as you note, we need to handle certain symlinks;
in my installation this is only needed for Makefile.port.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Attachments:
distdir.patchtext/x-diff; charset=us-asciiDownload
Index: GNUmakefile.in
===================================================================
RCS file: /home/alvherre/Code/cvs/pgsql/GNUmakefile.in,v
retrieving revision 1.46
diff -c -p -r1.46 GNUmakefile.in
*** GNUmakefile.in 9 Feb 2007 15:55:57 -0000 1.46
--- GNUmakefile.in 20 Aug 2008 20:59:18 -0000
*************** distdir:
*** 107,112 ****
--- 107,126 ----
|| cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
fi || exit; \
done
+ for x in `find . \\( -type d -o -path "*$(distdir)*" -prune \\) -o -print`; do \
+ file=`expr X$$x : 'X\./\(.*\)'`; \
+ dir=`dirname $$file`; \
+ if test ! -d "$(distdir)/$$dir" ; then \
+ continue; \
+ fi; \
+ if test -L "$$file" && test -e "$(distdir)/$$file" ; then \
+ continue; \
+ fi; \
+ ln "$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
+ || cp "$$file" "$(distdir)/$$file" \
+ || exit; \
+ done
+
$(MAKE) -C $(distdir) distprep
$(MAKE) -C $(distdir)/doc/src/sgml/ HISTORY INSTALL regress_README
cp $(distdir)/doc/src/sgml/HISTORY $(distdir)/