NetBSD Problem Report #39737

From  Sun Oct 12 16:49:32 2008
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 88A3863B88A
	for <>; Sun, 12 Oct 2008 16:49:32 +0000 (UTC)
Message-Id: <>
Date: Sun, 12 Oct 2008 16:46:47 +0000 (UTC)
Subject: the build attempts to run autoconf/automake/autoheader
X-Send-Pr-Version: 3.95

>Number:         39737
>Category:       misc
>Synopsis:       the build attempts to run autoconf/automake/autoheader
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 12 16:50:00 +0000 2008
>Originator:     Alan Barrett
>Release:        NetBSD 4.99.72
Not much
System: NetBSD 4.99.72
Architecture: i386
Machine: i386
        Some makefiles contain rules that attempt to run autoconf,
        automake, autoheader, and similar tools, depending on the time
        stamps of various files.  If the source tree is read-only, this
        will fail.  If the source tree is writable, it will cause files
        to be overwritten, or unwanted files to be created.

	check out a clean tree.

	cd src
	touch dist/file/
	sh ./ tools

	Notice that it wants to run autoconf in the dist/file directory,
	which will overwrite or create files in the source tree.

        Of course "dist/file" is not the only subdirectory that suffers
        from this problem.

        A proper fix would involve changes to autoconf to prevent it
        from adding unwanted rules to the Makefiles.  Note that some
        programs in the source tree already use a version of autoconf
        that makes such rules conditional on "maintainer mode", which is
        good enough.

	For a workaround, run the following script and commit the results.

[begin script]

perlscript="$( cat <<\EOF 
    # For all values of target and exclude in the lists below,
    # for each Makefile line of the form "[whitespace]...
    # change it to " comment ...",
    # except if it was of the form "[whitespace]exclude...",
    # in which case leave it unchanged.
    $comment = '#';
    @targets = (
                'configure', 'config.status',
                'ACLOCAL_M4)', 'aclocal.m4',
                '.am', '.ac', '.in', '.hin'
    @excludes = ('#', '@MAINT');
    $target_re = '(?:' . join('|', map {quotemeta($_)} @targets) . ')';
    $exclude_re = '(?:' . join('|', map {quotemeta($_)} @excludes) . ')';
    while (<>) {
	s/(${target_re}:)\s*(?!${exclude_re})(\S)/$1 ${comment} $2/o;
	if (eof) {
	    print STDERR "$ARGV\n";

find . -name '*[Mm]akefile*' -print0 \
| xargs -0 perl -i -e "$perlscript"

[end script]

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.