X Strike Force X.Org X11 SVN commit: r1353 - trunk/xsfbs
Author: dnusinow
Date: 2006-02-27 22:36:54 -0500 (Mon, 27 Feb 2006)
New Revision: 1353
Modified:
trunk/xsfbs/xsfbs-autoreconf.mk
Log:
Add Eugene's latest fixes including configurability
Modified: trunk/xsfbs/xsfbs-autoreconf.mk
===================================================================
--- trunk/xsfbs/xsfbs-autoreconf.mk 2006-02-27 05:22:17 UTC (rev 1352)
+++ trunk/xsfbs/xsfbs-autoreconf.mk 2006-02-28 03:36:54 UTC (rev 1353)
@@ -13,32 +13,42 @@
# The only usable target here is 'autoreconf`. Other targets are not
# supposed to be called directly. DO NOT invoke them, unless you know what
# you are doing.
-# The autoreconf target will check if configure.ac and/or Makefile.am's
+# The autoreconf target will check if files with names in $(RECONF_CHECKFILES)
# were changed during patching (from upstream version or from previously
# autoreconfed version) and call actual autoreconfing if they were.
# The actual autoreconfing target (doautoreconf) WILL FAIL after
# calling autoreconf and pushing changes into quilt stack by design. It
# should never be invoked by automatic build process.
-# The proposed use is including xsfbs-autoreconf.mk AFTER xsfbs.mk, as it
-# depends on some targets from xsfbs.mk and adding autoreconf into clean's
-# prerequisites before xsfclean like:
+# The proposed use is adding autoreconf into clean's prerequisites before
+# xsfclean like:
# - clean: xsfclean
# + clean: autoreconf xsfclean
# This will ensure it is called when you build package with dpkg-buildpackage.
# This dir will be used for producing diff of autoreconfed tree
-RECONF_DIR:=xsfautoreconf
+RECONF_DIR := xsfautoreconf
+# This files will be checked for changes
+RECONF_CHECKFILES += configure.ac Makefile.am
+
+# This files will not be hardlinked but copied
+RECONF_NOLINKFILES += aclocal.m4
+
+# This files/dirs will be pruned after autoreconf run
+RECONF_PRUNEFILES += autom4te.cache config.h.in~
+
# Internal target. Never invoke directly.
stampdir_target+=check.md5sum
$(STAMP_DIR)/check.md5sum:
dh_testdir
$(MAKE) -f debian/rules prepare
- find . -wholename ./$(STAMP_DIR) -prune -o -name configure.ac -print \
- -o -name Makefile.am -print | xargs md5sum >$@
+ for F in $(RECONF_CHECKFILES); do \
+ find . -wholename ./$(STAMP_DIR) -prune -o -name $$F -print | \
+ xargs --no-run-if-empty md5sum >>$@; \
+ done
# Internal target. Never invoke directly.
-debian/patches/clean.md5sum:
+$(STAMP_DIR)/clean.md5sum:
dh_testdir
$(MAKE) -f debian/rules unpatch
rm -f $(STAMP_DIR)/check.md5sum
@@ -46,12 +56,15 @@
mv $(STAMP_DIR)/check.md5sum $@
# Internal target. Never invoke directly.
-debian/patches/patched.md5sum: debian/patches/clean.md5sum
+debian/patches/patched.md5sum:
dh_testdir
+ [ -f $(STAMP_DIR)/clean.md5sum ] || \
+ $(MAKE) -f debian/rules $(STAMP_DIR)/clean.md5sum
+
$(MAKE) -f debian/rules patch
rm -f $(STAMP_DIR)/check.md5sum
$(MAKE) -f debian/rules $(STAMP_DIR)/check.md5sum
- if ! diff debian/patches/clean.md5sum \
+ if ! diff $(STAMP_DIR)/clean.md5sum \
$(STAMP_DIR)/check.md5sum > /dev/null; then \
$(MAKE) -f debian/rules doautoreconf; \
else \
@@ -61,13 +74,13 @@
# Internal target. Never invoke directly.
,PHONY: doautoreconf
doautoreconf: patch
- quilt push -a >$(STAMP_DIR)/log/autoreconf 2>&1 || true
+ quilt push -a >>$(STAMP_DIR)/log/autoreconf 2>&1 || true
if quilt applied | grep ^autoreconf.diff$$ > /dev/null; then \
- quilt pop -a >$(STAMP_DIR)/log/autoreconf 2>&1; \
+ quilt pop -a >>$(STAMP_DIR)/log/autoreconf 2>&1; \
quilt rename -p autoreconf.diff autoreconf-old.diff \
- >$(STAMP_DIR)/log/autoreconf 2>&1; \
- quilt delete autoreconf-old.diff >$(STAMP_DIR)/log/autoreconf 2>&1; \
- quilt push -a >$(STAMP_DIR)/log/autoreconf 2>&1; \
+ >>$(STAMP_DIR)/log/autoreconf 2>&1; \
+ quilt delete autoreconf-old.diff >>$(STAMP_DIR)/log/autoreconf 2>&1; \
+ quilt push -a >>$(STAMP_DIR)/log/autoreconf 2>&1; \
fi
if [ -e $(RECONF_DIR) ]; then \
@@ -79,16 +92,27 @@
find . -maxdepth 1 -mindepth 1 ! -wholename ./$(RECONF_DIR) \
-a ! -wholename ./debian -a ! -wholename ./patches \
-a ! -wholename ./.pc -a ! -wholename ./$(STAMP_DIR) | \
- xargs -i{} cp -al {} $(RECONF_DIR)/before
+ xargs -i{} cp -al {} $(RECONF_DIR)/before/
cp -al $(RECONF_DIR)/before $(RECONF_DIR)/after
+ for F in $(RECONF_NOLINKFILES); do \
+ find . -wholename ./$(RECONF_DIR) -prune -o -wholename ./debian \
+ -prune -o -wholename ./$(STAMP_DIR) -prune -o -name $$F \
+ -print | \
+ xargs --no-run-if-empty -i{} cp --remove-destination {} \
+ $(RECONF_DIR)/after/{}; \
+ done
+
cd $(RECONF_DIR)/after && autoreconf -v --install && \
- rm -r autom4te.cache && rm -f *~
+ for F in $(RECONF_PRUNEFILES); do \
+ find . -name $$F -print | \
+ xargs --no-run-if-empty rm -r; \
+ done
cd $(RECONF_DIR) && diff -Nru before after > autoreconf.diff || true
quilt import $(RECONF_DIR)/autoreconf.diff \
- >$(STAMP_DIR)/log/autoreconf 2>&1
+ >>$(STAMP_DIR)/log/autoreconf 2>&1
mv $(STAMP_DIR)/check.md5sum debian/patches/patched.md5sum
@@ -113,7 +137,7 @@
exit 1;
.PHONY: autoreconf
-autoreconf: debian/patches/clean.md5sum patch debian/patches/patched.md5sum $(STAMP_DIR)/check.md5sum
+autoreconf: debian/patches/patched.md5sum patch $(STAMP_DIR)/check.md5sum
if ! diff $(STAMP_DIR)/check.md5sum \
debian/patches/patched.md5sum > /dev/null; then \
$(MAKE) -f debian/rules doautoreconf; \
Reply to: