Subject: Re: CVS commit: pkgsrc/net/mtr
To: Frederick Bruckman <fredb@immanent.net>
From: Johnny Lam <jlam@jgrind.org>
List: tech-pkg
Date: 10/25/2001 12:01:47
On Thu, Oct 25, 2001 at 01:36:31PM -0500, Frederick Bruckman wrote:
> On Thu, 25 Oct 2001, Johnny Lam wrote:
> 
> > We could patch configure and the Makefile.in files, but we'd still have
> > the problem where, on machines that have automake installed, the configure-
> > generated Makefiles detect that the configure script is too new, and will
> > do the whole "aclocal; automake; autoconf; autoheader" sequence, which
> > overwrites all of our changes.  We need something like:
> 
> Your solution is needlessly complicated. All you have to do is "touch"
> the appropriate files in a pre-configure target, usually "configure",
> if it wasn't patched, all "Makefile.in"'s, and some kind of stamp
> file, like "stamp-h.in". You can usually see what to do by inspecting
> the "Makefile.in"'s. ("configure" is hardly ever too new, by the way
> -- it usually goes "aclocal; autoheader; automake; autoconf", so
> "configure"  is the final target of all this.)
> 
> There are lot's of examples in "pkgsrc" of how to do this. See
> "chat/xchat" e.g..

I'm all for a better solution.  I've made a patch to bsd.pkg.mk based on the
one in chat/xchat.  The behaviour is turned on by defining SUPPRESS_AUTOMAKE
in the package Makefile.  I've tested on chat/kyahoo.  Do we want something
like this?  Can someone come up with a better sounding variable than
"SUPPRESS_AUTOMAKE"?  

	-- Johnny Lam <jlam@jgrind.org>

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.828
diff -u -r1.828 bsd.pkg.mk
--- bsd.pkg.mk	2001/10/24 19:42:28	1.828
+++ bsd.pkg.mk	2001/10/25 18:56:05
@@ -1509,6 +1509,29 @@
 	${_PKG_SILENT}${_PKG_DEBUG}${TRUE}
 .endif
 
+.if defined(SUPPRESS_AUTOMAKE)
+#
+# Prevent invocation of GNU "auto*" during the build process driven by the
+# generated Makefiles by touching various auto{conf,make} source files to
+# make them up-to-date.
+#
+AUTOMAKE_PATTERNS+=	*.m4
+AUTOMAKE_PATTERNS+=	*.in
+AUTOMAKE_PATTERNS+=	configure
+_AUTOMAKE_PATTERNS_FIND=	\
+	${AUTOMAKE_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1}
+
+_CONFIGURE_PREREQ+=	suppress-automake
+suppress-automake:
+.  if defined(HAS_CONFIGURE)
+	${_PKG_SILENT}${_PKG_DEBUG}					\
+	cd ${WRKSRC};							\
+	${FIND} . ${_AUTOMAKE_PATTERNS_FIND} | ${XARGS} ${TOUCH} ${TOUCH_ARGS}
+.  else
+	${_PKG_SILENT}${_PKG_DEBUG}${TRUE}
+.  endif
+.endif
+
 .if !target(do-configure)
 do-configure: ${_CONFIGURE_PREREQ}
 	${_PKG_SILENT}${_PKG_DEBUG}if [ -f ${SCRIPTDIR}/configure ]; then \