Subject: Re: CVS commit: pkgsrc/net/mtr
To: Jim Wise <jwise@draga.com>
From: Johnny Lam <jlam@jgrind.org>
List: tech-pkg
Date: 10/25/2001 11:14:08
[Reposted to tech-pkg@netbsd.org]

On Thu, Oct 25, 2001 at 01:15:43PM -0400, Jim Wise wrote:
> 
[ Regarding a recent commit to net/mtr/Makefile to run automake]
>
> Any chance of importing a re-generated configure and Makefile.in's so
> that the user doesn't need auto{conf,make} installed?  Or is this one of
> those packages where the Makefiles explicitly call automake in a way
> that's hard to patch around.
> 
> As a user of some pretty slow machines (no, not the ones I do java work
> on :-) ), I'm painfully aware that it would be nice to avoid DEPENDing
> on autoconf or automake for normal package builds...

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:

AM_MISSING=     ${WRKSRC}/missing
MAKE_FLAGS+=    ACLOCAL="${AM_MISSING} aclocal"
MAKE_FLAGS+=    AUTOCONF="${AM_MISSING} autoconf"
MAKE_FLAGS+=    AUTOHEADER="${AM_MISSING} autoheader"
MAKE_FLAGS+=    AUTOMAKE="${AM_MISSING} automake"

post-configure:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        for file in `${FIND} ${WRKSRC} -name "config.status"`; do       \
                ( ${ECHO} '#!/bin/sh';                                  \
                  ${ECHO} 'for file in $${CONFIG_FILES} $${CONFIG_HEADERS}; do';
 \
                  ${ECHO} '     ${TOUCH} ${TOUCH_ARGS} $${file}';       \
                  ${ECHO} 'done';                                       \
                ) > $${file};                                           \
                ${CHMOD} +x $${file};                                   \
        done;                                                           \
        for file in `${FIND} ${WRKSRC} -name "missing"`; do             \
                ( ${ECHO} '#!/bin/sh';                                  \
                  ${ECHO} '${ECHO} missing $1';                         \
                ) > $${file};                                           \
                ${CHMOD} +x $${file};                                   \
        done;                                                           \

This bit of code does the following:

	1) Forces the automake utilities not to be found during build.
	2) Replaces the config.status and missing scripts with ones that
	   do nothing.

We'd need to wrap the whole thing in some sort of .if defined() ... .endif
as there are packages that genuinely use automake (x11/lesstif is one).

The above isn't perfect...it's just an idea, but perhaps we can rework it
to something usable, or come up with something better?

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>