]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.pl (init_tables): Allow spaces on the right hand side
authorPavel Roskin <proski@gnu.org>
Tue, 12 Dec 2000 12:45:41 +0000 (12:45 +0000)
committerPavel Roskin <proski@gnu.org>
Tue, 12 Dec 2000 12:45:41 +0000 (12:45 +0000)
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.

ChangeLog
acidentifiers
autoscan.in
autoscan.pl
bin/autoscan.in
lib/autoscan/identifiers

index 2aa16a82c7f0397e0c15e77d8ebcd7807faea460..4e67e02f972af37582ad2b2bf6d4f83869a34d22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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
index e4ae03b057e8fe4b5f97f1e483a4ee883b232889..ebf620088fbf44f248380c70a0915fd835ed2d6b 100644 (file)
@@ -29,7 +29,7 @@ S_ISREG               AC_HEADER_STAT
 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
index baf301c02eecae09ae8d3c6c8ef91509170425bd..d7d6a36ee91c11a4be2cd8153acd2a57d103e3df 100644 (file)
@@ -125,7 +125,10 @@ sub init_tables
       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);
@@ -210,10 +213,10 @@ sub scan_c_file
 
     # 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});
     }
   }
@@ -252,15 +255,15 @@ sub scan_makefile
     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}++;
     }
   }
@@ -298,7 +301,7 @@ sub scan_sh_file
     s/@[^@]*@//g;
 
     # Tokens in the code.
-    while (s/\W([a-zA-Z_]\w*)\W/ /) {
+    while (s/\b([a-zA-Z_]\w*)\b/ /) {
       $programs{$1}++;
     }
   }
@@ -324,6 +327,9 @@ sub output
   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;
index baf301c02eecae09ae8d3c6c8ef91509170425bd..d7d6a36ee91c11a4be2cd8153acd2a57d103e3df 100644 (file)
@@ -125,7 +125,10 @@ sub init_tables
       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);
@@ -210,10 +213,10 @@ sub scan_c_file
 
     # 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});
     }
   }
@@ -252,15 +255,15 @@ sub scan_makefile
     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}++;
     }
   }
@@ -298,7 +301,7 @@ sub scan_sh_file
     s/@[^@]*@//g;
 
     # Tokens in the code.
-    while (s/\W([a-zA-Z_]\w*)\W/ /) {
+    while (s/\b([a-zA-Z_]\w*)\b/ /) {
       $programs{$1}++;
     }
   }
@@ -324,6 +327,9 @@ sub output
   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;
index baf301c02eecae09ae8d3c6c8ef91509170425bd..d7d6a36ee91c11a4be2cd8153acd2a57d103e3df 100644 (file)
@@ -125,7 +125,10 @@ sub init_tables
       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);
@@ -210,10 +213,10 @@ sub scan_c_file
 
     # 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});
     }
   }
@@ -252,15 +255,15 @@ sub scan_makefile
     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}++;
     }
   }
@@ -298,7 +301,7 @@ sub scan_sh_file
     s/@[^@]*@//g;
 
     # Tokens in the code.
-    while (s/\W([a-zA-Z_]\w*)\W/ /) {
+    while (s/\b([a-zA-Z_]\w*)\b/ /) {
       $programs{$1}++;
     }
   }
@@ -324,6 +327,9 @@ sub output
   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;
index e4ae03b057e8fe4b5f97f1e483a4ee883b232889..ebf620088fbf44f248380c70a0915fd835ed2d6b 100644 (file)
@@ -29,7 +29,7 @@ S_ISREG               AC_HEADER_STAT
 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