pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Instead of patching the generated config.status scr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6e6729252523
branches:  trunk
changeset: 505362:6e6729252523
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Jan 03 00:41:51 2006 +0000

description:
Instead of patching the generated config.status script, patch the GNU
configure script itself so that the generated config.status script
does what we want (just exit if asked to "recheck").  This ensures
the timestamp for config.status is earlier than the timestamps for
the files that config.status generates (Makefile, config.h, etc.).

This fixes some problems where some packages end up "rebuilding" as
part of the install target, which makes the rebuilt files owned by
root and makes cleaning the work directory fail.

diffstat:

 mk/bsd.pkg.mk |  56 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 29 deletions(-)

diffs (85 lines):

diff -r 62c0d92335b1 -r 6e6729252523 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Tue Jan 03 00:06:49 2006 +0000
+++ b/mk/bsd.pkg.mk     Tue Jan 03 00:41:51 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1780 2006/01/02 23:24:58 dmcmahill Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1781 2006/01/03 00:41:51 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -690,13 +690,11 @@
        config.sub */config.sub */*/config.sub
 CONFIG_RPATH_OVERRIDE?=                # set by platform file as needed
 #
-# By default, override config.status for GNU configure packages.  We
-# never want it to execute after the configure phase has ended as it
-# might overwrite any post-configure changes we might have made to the
-# generated files.
+# By default, override GNU configure scripts so that the generated
+# config.status scripts never do anything on "recheck".
 #
-CONFIG_STATUS_OVERRIDE?=       \
-       config.status */config.status */*/config.status
+CONFIGURE_SCRIPTS_OVERRIDE?=   \
+       configure */configure */*/configure
 .endif
 
 #
@@ -1761,6 +1759,28 @@
 .  endif
 .endif
 
+.if defined(CONFIGURE_SCRIPTS_OVERRIDE)
+_CONFIGURE_PREREQ+=    do-configure-scripts-override
+.PHONY: do-configure-scripts-override
+do-configure-scripts-override:
+.  for _pattern_ in ${CONFIGURE_SCRIPTS_OVERRIDE}
+       ${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC};                        \
+       for file in ${_pattern_}; do                                    \
+               if ${TEST} -f "$$file"; then                            \
+                       ${AWK} '/ *-recheck *\| *--recheck.*\)/ {       \
+                                       print;                          \
+                                       print "    # Avoid regenerating for rechecks on pkgsrc"; \
+                                       print "    exit 0";             \
+                                       next;                           \
+                               }                                       \
+                               { print }' $$file > $$file.override &&  \
+                       ${CHMOD} +x $$file.override &&                  \
+                       ${MV} -f $$file.override $$file;                \
+               fi;                                                     \
+       done
+.  endfor
+.endif
+
 PKGCONFIG_OVERRIDE_SED= \
        '/^Libs:.*[     ]/s|-L\([       ]*[^    ]*\)|${COMPILER_RPATH_FLAG}\1 -L\1|g'
 PKGCONFIG_OVERRIDE_STAGE?=     pre-configure
@@ -1848,28 +1868,6 @@
 .  endif
 .endif
 
-.if defined(CONFIG_STATUS_OVERRIDE)
-_CONFIGURE_POSTREQ+=   do-config-status-override
-.PHONY: do-config-status-override
-do-config-status-override:
-.  for _pattern_ in ${CONFIG_STATUS_OVERRIDE}
-       ${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC};                        \
-       for file in ${_pattern_}; do                                    \
-               if [ -f "$$file" ]; then                                \
-                       ${MV} -f $$file $$file.overridden;              \
-                       ${AWK} '/ *-recheck *\| *--recheck.*\)/ {       \
-                                       print;                          \
-                                       print "    exit 0";             \
-                                       next;                           \
-                               }                                       \
-                               { print }                               \
-                              ' $$file.overridden > $$file;            \
-                       ${CHMOD} +x $$file;                             \
-               fi;                                                     \
-       done
-.  endfor
-.endif
-
 .PHONY: post-configure
 post-configure: ${_CONFIGURE_POSTREQ}
 



Home | Main Index | Thread Index | Old Index