in autoscan tables. Die if there are no spaces at all.
(scan_c_file): Use b instead of W so that keywords match at
the beginning and the end of the line.
(scan_sh_file): Likewise.
(scan_makefile): Likewise. Use B to match before `-l'.
(output): Suggest AC_CONFIG_HEADER if any C/C++ sources are
found.
* acidentifiers: Update macros for structure members st_blksize
and st_rdev.
+2000-12-12 Pavel Roskin <proski@gnu.org>
+
+ * autoscan.pl (init_tables): Allow spaces on the right hand side
+ in autoscan tables. Die if there are no spaces at all.
+ (scan_c_file): Use \b instead of \W so that keywords match at
+ the beginning and the end of the line.
+ (scan_sh_file): Likewise.
+ (scan_makefile): Likewise. Use \B to match before `-l'.
+ (output): Suggest AC_CONFIG_HEADER if any C/C++ sources are
+ found.
+ * acidentifiers: Update macros for structure members st_blksize
+ and st_rdev.
+
2000-12-12 Akim Demaille <akim@epita.fr>
* tests/compile.at (GNU Fortran 77): Be robust to compilers that
S_ISSOCK AC_HEADER_STAT
# Members of structures.
-st_blksize AC_STRUCT_ST_BLKSIZE
+st_blksize AC_CHECK_MEMBERS([struct stat.st_blksize])
st_blocks AC_STRUCT_ST_BLOCKS
-st_rdev AC_STRUCT_ST_RDEV
+st_rdev AC_CHECK_MEMBERS([struct stat.st_rdev])
tm_zone AC_STRUCT_TIMEZONE
die "$me: cannot open $datadir/ac$kind: $!\n";
while (<TABLE>) {
next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
- ($word, $macro) = split;
+ unless (/^(\S+)\s+(\S.*)$/) {
+ die "$me: cannot parse definition in $datadir/ac$kind:\n$_\n";
+ }
+ ($word, $macro) = ($1, $2);
eval "\$$kind" . "_macros{\$word} = \$macro";
}
close(TABLE);
# Tokens in the code.
# Maybe we should ignore function definitions (in column 0)?
- while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*\(/ /) {
$functions{$1}++ if !defined($c_keywords{$1});
}
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$identifiers{$1}++ if !defined($c_keywords{$1});
}
}
s/@[^@]*@//g;
# Variable assignments.
- while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*=/ /) {
$makevars{$1}++;
}
# Libraries.
- while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+ while (s/\B-l([a-zA-Z_]\w*)\b/ /) {
$libraries{$1}++;
}
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
s/@[^@]*@//g;
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
if (defined $initfile) {
print CONF "AC_CONFIG_SRCDIR([$initfile])\n";
}
+ if (defined $cfiles[0]) {
+ print CONF "AC_CONFIG_HEADER([config.h])\n";
+ }
&output_programs;
&output_headers;
die "$me: cannot open $datadir/ac$kind: $!\n";
while (<TABLE>) {
next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
- ($word, $macro) = split;
+ unless (/^(\S+)\s+(\S.*)$/) {
+ die "$me: cannot parse definition in $datadir/ac$kind:\n$_\n";
+ }
+ ($word, $macro) = ($1, $2);
eval "\$$kind" . "_macros{\$word} = \$macro";
}
close(TABLE);
# Tokens in the code.
# Maybe we should ignore function definitions (in column 0)?
- while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*\(/ /) {
$functions{$1}++ if !defined($c_keywords{$1});
}
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$identifiers{$1}++ if !defined($c_keywords{$1});
}
}
s/@[^@]*@//g;
# Variable assignments.
- while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*=/ /) {
$makevars{$1}++;
}
# Libraries.
- while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+ while (s/\B-l([a-zA-Z_]\w*)\b/ /) {
$libraries{$1}++;
}
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
s/@[^@]*@//g;
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
if (defined $initfile) {
print CONF "AC_CONFIG_SRCDIR([$initfile])\n";
}
+ if (defined $cfiles[0]) {
+ print CONF "AC_CONFIG_HEADER([config.h])\n";
+ }
&output_programs;
&output_headers;
die "$me: cannot open $datadir/ac$kind: $!\n";
while (<TABLE>) {
next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
- ($word, $macro) = split;
+ unless (/^(\S+)\s+(\S.*)$/) {
+ die "$me: cannot parse definition in $datadir/ac$kind:\n$_\n";
+ }
+ ($word, $macro) = ($1, $2);
eval "\$$kind" . "_macros{\$word} = \$macro";
}
close(TABLE);
# Tokens in the code.
# Maybe we should ignore function definitions (in column 0)?
- while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*\(/ /) {
$functions{$1}++ if !defined($c_keywords{$1});
}
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$identifiers{$1}++ if !defined($c_keywords{$1});
}
}
s/@[^@]*@//g;
# Variable assignments.
- while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+ while (s/\b([a-zA-Z_]\w*)\s*=/ /) {
$makevars{$1}++;
}
# Libraries.
- while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+ while (s/\B-l([a-zA-Z_]\w*)\b/ /) {
$libraries{$1}++;
}
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
s/@[^@]*@//g;
# Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
+ while (s/\b([a-zA-Z_]\w*)\b/ /) {
$programs{$1}++;
}
}
if (defined $initfile) {
print CONF "AC_CONFIG_SRCDIR([$initfile])\n";
}
+ if (defined $cfiles[0]) {
+ print CONF "AC_CONFIG_HEADER([config.h])\n";
+ }
&output_programs;
&output_headers;
S_ISSOCK AC_HEADER_STAT
# Members of structures.
-st_blksize AC_STRUCT_ST_BLKSIZE
+st_blksize AC_CHECK_MEMBERS([struct stat.st_blksize])
st_blocks AC_STRUCT_ST_BLOCKS
-st_rdev AC_STRUCT_ST_RDEV
+st_rdev AC_CHECK_MEMBERS([struct stat.st_rdev])
tm_zone AC_STRUCT_TIMEZONE