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

discussion of mass-filing for autoconf macro quote warnings



Current autoconf issues warnings when a macro being defined does not have it's
named quoted properly.  This warning occurs when the following is in an m4
file:

AC_DEFUN(macro_name,definition)

The fix is to do the above as:

AC_DEFUN([macro_name],definition)

The attached perl script can be run over the warnings produced by autoconf;
it gives a list of package/version, and the files that the package contains.
It resolves symlinks(in the case of alternatives), to report the real package.
It is not all inclusive, and only reports the macros in m4 files that are
referenced by configure.{in,ac}.

Example output follows:

Package: libaudiofile-dev
Version: 0.2.6-3

12: warning: underquoted definition of AM_PATH_AUDIOFILE

Package: libgsl0
Version: 1.4-4

5: warning: underquoted definition of AM_PATH_GSL

Package: libgcrypt-dev
Version: 1.1.12-4

17: warning: underquoted definition of AM_PATH_LIBGCRYPT

Package: tcl8.4-dev
Version: 8.4.6-1

20: warning: underquoted definition of SC_PATH_TCLCONFIG
124: warning: underquoted definition of SC_PATH_TKCONFIG
228: warning: underquoted definition of SC_LOAD_TCLCONFIG
295: warning: underquoted definition of SC_LOAD_TKCONFIG
333: warning: underquoted definition of SC_ENABLE_SHARED
373: warning: underquoted definition of SC_ENABLE_FRAMEWORK
422: warning: underquoted definition of SC_ENABLE_THREADS
515: warning: underquoted definition of SC_ENABLE_SYMBOLS
572: warning: underquoted definition of SC_ENABLE_LANGINFO
619: warning: underquoted definition of SC_CONFIG_MANPAGES
736: warning: underquoted definition of SC_CONFIG_CFLAGS
1824: warning: underquoted definition of SC_SERIAL_PORT
1953: warning: underquoted definition of SC_MISSING_POSIX_HEADERS
2033: warning: underquoted definition of SC_PATH_X
2118: warning: underquoted definition of SC_BLOCKING_STYLE
2183: warning: underquoted definition of SC_TIME_HANDLER
2260: warning: underquoted definition of SC_BUGGY_STRTOD
2322: warning: underquoted definition of SC_TCL_LINK_LIBS
2398: warning: underquoted definition of SC_TCL_EARLY_FLAG
2410: warning: underquoted definition of SC_TCL_EARLY_FLAGS
2442: warning: underquoted definition of SC_TCL_64BIT_FLAGS

Package: libgnutls7-dev
Version: 0.8.12-5

12: warning: underquoted definition of AM_PATH_LIBGNUTLS_EXTRA

Package: libgnutls7-dev
Version: 0.8.12-5

12: warning: underquoted definition of AM_PATH_LIBGNUTLS

Package: pkg-config
Version: 0.15.0-3

5: warning: underquoted definition of PKG_CHECK_MODULES

Package: libesd0-dev
Version: 0.2.29-1

10: warning: underquoted definition of AM_PATH_ESD
175: warning: underquoted definition of AM_ESD_SUPPORTS_MULTIPLE_RECORD

Package: check
Version: 0.8.4-1

5: warning: underquoted definition of AM_PATH_CHECK

Package: libgconf2-dev
Version: 2.4.0.1-4

8: warning: underquoted definition of AM_GCONF_SOURCE_2

Package: libglib2.0-dev
Version: 2.2.3-1

8: warning: underquoted definition of AM_PATH_GLIB_2_0

Package: liborbit2-dev
Version: 1:2.8.3-2

4: warning: underquoted definition of AM_PATH_ORBIT2

Package: xdelta
Version: 1.1.3-6

7: warning: underquoted definition of AM_PATH_XDELTA

Package: libglib2.0-dev
Version: 2.2.3-1

378: warning: underquoted definition of AM_GLIB_GNU_GETTEXT
379: warning: underquoted definition of AM_GLIB_DEFINE_LOCALEDIR

Package: libopencdk-dev
Version: 1:0.4.2-3

13: warning: underquoted definition of AM_PATH_LIBOPENCDK

Package: libsdl1.0-dev
Version: 1.0.8-8

11: warning: underquoted definition of AM_PATH_SDL
#!/usr/bin/perl -w

use strict;
use warnings;
use Data::Dumper;

my %file_warning;
my %file_pkg;
my %pkg_ver;
my %pkgs;
die( "No file specified!" ) if ( !$ARGV[ 0 ] );

open( AUTOCONF_WARNINGS, "< $ARGV[ 0 ]" );
while ( <AUTOCONF_WARNINGS> ) {
	if ( m/([^:]+):\s*(.*)/ ) {
		my $file = `readlink -f $1`;
		chomp( $file );
		push( @{ $file_warning{ $file } }, $2 );
	}
}
close( AUTOCONF_WARNINGS );
open( DPKG, "dpkg -S " . join( " ", keys( %file_warning ) ) . " |" );
while ( <DPKG> ) {
	if ( m/([^:]+):\s*(.*)/ ) {
		$file_pkg{ $2 } = $1;
		$pkgs{ $1 } = 1;
	}
}
close( DPKG );
open( DPKG, "dpkg -s " . join( " ", keys( %pkgs ) ) . " |" );
$/ = '';
while ( <DPKG> ) {
	my ( $pkg, $ver );
	$pkg = $1 if ( m/^Package: ([^\n]+)\n/m );
	$ver = $1 if ( m/^Version: ([^\n]+)\n/m );
	$pkg_ver{ $pkg } = $ver if ( $pkg && $ver );
}
close( DPKG );

while ( my ( $file, $warnings ) = each( %file_warning ) ) {
	my $pkg = $file_pkg{ $file };
	my $ver = $pkg_ver{ $pkg } if ( $pkg );
	if ( $pkg ) {
		print( "Package: $pkg\n" );
		print( "Version: $ver\n" ) if ( $ver );
		print( "\n" . join( "\n", @$warnings ) . "\n\n" );
	} else {
	}
}

Reply to: