]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.pl: Use Getopt::Long;
authorAkim Demaille <akim@epita.fr>
Tue, 1 Aug 2000 10:05:11 +0000 (10:05 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 1 Aug 2000 10:05:11 +0000 (10:05 +0000)
* acidentifiers: Classify, sort.

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

index 4f93921f15055178a4e34c576bb5086a6653e994..070c6e5af8030dc9a4d36ff7b924c0301080a7ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-01  Akim Demaille  <akim@epita.fr>
+
+       * autoscan.pl: Use Getopt::Long;
+       * acidentifiers: Classify, sort.
+
 2000-08-01  Akim Demaille  <akim@epita.fr>
 
        * aclang.m4 (_AC_PROG_CXX_GNU, _AC_PROG_CC_GNU, _AC_PROG_F77_GNU):
index a7979c01831c0e48b39f5fdb1c1da1cc3722a879..e667b2907e93b17adaf06ecaba8482950c638a26 100644 (file)
@@ -1,22 +1,33 @@
+# acidentifiers -- identifiers which are not involved in function calls.
+
+# Keywords.
+const          AC_C_CONST
+inline         AC_C_INLINE
+
+# Variables.
 sys_siglist    AC_DECL_SYS_SIGLIST
+
+# Types.
+gid_t          AC_TYPE_UID_T
 mode_t         AC_TYPE_MODE_T
 off_t          AC_TYPE_OFF_T
 pid_t          AC_TYPE_PID_T
 size_t         AC_TYPE_SIZE_T
+timeval                AC_HEADER_TIME
+tm             AC_STRUCT_TM
 uid_t          AC_TYPE_UID_T
-gid_t          AC_TYPE_UID_T
-S_ISDIR                AC_HEADER_STAT
-S_ISREG                AC_HEADER_STAT
-S_ISCHR                AC_HEADER_STAT
+
+# Macros.
 S_ISBLK                AC_HEADER_STAT
+S_ISCHR                AC_HEADER_STAT
+S_ISDIR                AC_HEADER_STAT
 S_ISFIFO       AC_HEADER_STAT
 S_ISLNK                AC_HEADER_STAT
+S_ISREG                AC_HEADER_STAT
 S_ISSOCK       AC_HEADER_STAT
+
+# Members of structures.
 st_blksize     AC_STRUCT_ST_BLKSIZE
 st_blocks      AC_STRUCT_ST_BLOCKS
 st_rdev                AC_STRUCT_ST_RDEV
-timeval                AC_HEADER_TIME
-tm             AC_STRUCT_TM
 tm_zone                AC_STRUCT_TIMEZONE
-const          AC_C_CONST
-inline         AC_C_INLINE
index b847dc78b02e1a13aeff1054341d140b2c4167e8..45f1ea983216ae6bfd2f6cc20151ba9e3be78938 100644 (file)
@@ -1,4 +1,4 @@
-#! @PERL@
+#! @PERL@ -w
 # autoscan - Create configure.scan (a preliminary configure.in) for a package.
 # Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 
@@ -20,6 +20,7 @@
 # Written by David MacKenzie <djm@gnu.ai.mit.edu>.
 
 require "find.pl";
+use Getopt::Long;
 
 $datadir = $ENV{"AC_MACRODIR"} || "@datadir@";
 ($me = $0) =~ s,.*/,,;
@@ -38,17 +39,14 @@ undef %programs_macros;
 
 exit 0;
 
-# Process any command line arguments.
-sub parse_args
+# Display usage (--help).
+sub print_usage
 {
-  # There are a couple of useless `\' below.  They are used to have
-  # Emacs fontify properly.
-  local ($usage) = <<EOD;
-Usage: $0 [OPTION] ... [SRCDIR]
+  print "Usage: $0 [OPTION] ... [SRCDIR]
 
 Examine source files in the directory tree rooted at SRCDIR, or the
 current directory if none is given.  Search the source files for
-common portability problems and create a file \`configure.scan' which
+common portability problems and create a file \`configure.scan\' which
 is a preliminary \`configure.in' for that package.
 
   -h, --help            print this help, then exit
@@ -59,61 +57,43 @@ Library directories:
   -A, --autoconf-dir=ACDIR  Autoconf's files location (rarely needed)
   -l, --localdir=DIR        location of \`aclocal.m4' and \`acconfig.h'
 
-Report bugs to <bug-autoconf\@gnu.org>.
-EOD
+Report bugs to <bug-autoconf\@gnu.org>.\n";
+  exit 0;
+}
 
-  local ($version) = <<'EOD';
-autoscan (GNU @PACKAGE@) @VERSION@
+# Display version (--version).
+sub print_version
+{
+  print "autoscan (GNU @PACKAGE@) @VERSION@
 Written by David J. MacKenzie.
 
 Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-EOD
-
-  local ($help) = "Try \`$me --help' for more information.";
-
-  local $need_datadir = 0;
-
-  foreach $_ (@ARGV) {
-    if (/^--autoconf-dir=(.*)/) {
-      $datadir = $1;
-    } elsif (/^--autoconf-dir/ || /^-A$/) {
-      $need_datadir = 1;
-    } elsif (/^--m[a-z]*=(.*)/) {
-      $datadir = $1;
-    } elsif (/^-m$/) {
-      $need_datadir = 1;
-    } elsif (/^--h/ || /^-h$/) {
-      print "$usage";
-      exit 0;
-    } elsif (/^--verb/ || /^-v$/) {
-      $verbose = 1;
-    } elsif (/^--vers/ || /^-V$/) {
-      print "$version";
-      exit 0;
-    } elsif (/^[^-]/) {
-      if ($need_datadir) {
-       $datadir = $_;
-       $need_datadir = 0;
-      } else {
-       die "$me: too many arguments\n$help" if defined($srcdir);
-       # Top level directory of the package being autoscanned.
-       $srcdir = $_;
-      }
-    } else {
-      die "$me: invalid option $_\n$help";
-    }
-  }
-
-  die "$me: missing argument to -m\n$help" if $need_datadir;
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+  exit 0;
+}
 
-  $srcdir="." if !defined($srcdir);
+# Process any command line arguments.
+sub parse_args
+{
+  Getopt::Long::Configure ("bundling");
+  Getopt::Long::GetOptions ("A|autoconf-dir|m|macrodir=s" => \$datadir,
+                           "h|help" => \&print_usage,
+                           "V|version" => \&print_version,
+                           "v|verbose+" => \$verbose)
+    or exit 1;
+
+  die "$me: too many arguments
+Try \`$me --help' for more information.\n"
+    if (@ARGV > 1);
+  ($srcdir) = @ARGV;
+  $srcdir = "."
+    if !defined($srcdir);
 
   print "srcdir=$srcdir\n" if $verbose;
   chdir $srcdir || die "$me: cannot cd to $srcdir: $!\n";
 
-  open(CONF, ">configure.scan") ||
+  open (CONF, ">configure.scan") ||
     die "$me: cannot create configure.scan: $!\n";
 }
 
index b847dc78b02e1a13aeff1054341d140b2c4167e8..45f1ea983216ae6bfd2f6cc20151ba9e3be78938 100644 (file)
@@ -1,4 +1,4 @@
-#! @PERL@
+#! @PERL@ -w
 # autoscan - Create configure.scan (a preliminary configure.in) for a package.
 # Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 
@@ -20,6 +20,7 @@
 # Written by David MacKenzie <djm@gnu.ai.mit.edu>.
 
 require "find.pl";
+use Getopt::Long;
 
 $datadir = $ENV{"AC_MACRODIR"} || "@datadir@";
 ($me = $0) =~ s,.*/,,;
@@ -38,17 +39,14 @@ undef %programs_macros;
 
 exit 0;
 
-# Process any command line arguments.
-sub parse_args
+# Display usage (--help).
+sub print_usage
 {
-  # There are a couple of useless `\' below.  They are used to have
-  # Emacs fontify properly.
-  local ($usage) = <<EOD;
-Usage: $0 [OPTION] ... [SRCDIR]
+  print "Usage: $0 [OPTION] ... [SRCDIR]
 
 Examine source files in the directory tree rooted at SRCDIR, or the
 current directory if none is given.  Search the source files for
-common portability problems and create a file \`configure.scan' which
+common portability problems and create a file \`configure.scan\' which
 is a preliminary \`configure.in' for that package.
 
   -h, --help            print this help, then exit
@@ -59,61 +57,43 @@ Library directories:
   -A, --autoconf-dir=ACDIR  Autoconf's files location (rarely needed)
   -l, --localdir=DIR        location of \`aclocal.m4' and \`acconfig.h'
 
-Report bugs to <bug-autoconf\@gnu.org>.
-EOD
+Report bugs to <bug-autoconf\@gnu.org>.\n";
+  exit 0;
+}
 
-  local ($version) = <<'EOD';
-autoscan (GNU @PACKAGE@) @VERSION@
+# Display version (--version).
+sub print_version
+{
+  print "autoscan (GNU @PACKAGE@) @VERSION@
 Written by David J. MacKenzie.
 
 Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-EOD
-
-  local ($help) = "Try \`$me --help' for more information.";
-
-  local $need_datadir = 0;
-
-  foreach $_ (@ARGV) {
-    if (/^--autoconf-dir=(.*)/) {
-      $datadir = $1;
-    } elsif (/^--autoconf-dir/ || /^-A$/) {
-      $need_datadir = 1;
-    } elsif (/^--m[a-z]*=(.*)/) {
-      $datadir = $1;
-    } elsif (/^-m$/) {
-      $need_datadir = 1;
-    } elsif (/^--h/ || /^-h$/) {
-      print "$usage";
-      exit 0;
-    } elsif (/^--verb/ || /^-v$/) {
-      $verbose = 1;
-    } elsif (/^--vers/ || /^-V$/) {
-      print "$version";
-      exit 0;
-    } elsif (/^[^-]/) {
-      if ($need_datadir) {
-       $datadir = $_;
-       $need_datadir = 0;
-      } else {
-       die "$me: too many arguments\n$help" if defined($srcdir);
-       # Top level directory of the package being autoscanned.
-       $srcdir = $_;
-      }
-    } else {
-      die "$me: invalid option $_\n$help";
-    }
-  }
-
-  die "$me: missing argument to -m\n$help" if $need_datadir;
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+  exit 0;
+}
 
-  $srcdir="." if !defined($srcdir);
+# Process any command line arguments.
+sub parse_args
+{
+  Getopt::Long::Configure ("bundling");
+  Getopt::Long::GetOptions ("A|autoconf-dir|m|macrodir=s" => \$datadir,
+                           "h|help" => \&print_usage,
+                           "V|version" => \&print_version,
+                           "v|verbose+" => \$verbose)
+    or exit 1;
+
+  die "$me: too many arguments
+Try \`$me --help' for more information.\n"
+    if (@ARGV > 1);
+  ($srcdir) = @ARGV;
+  $srcdir = "."
+    if !defined($srcdir);
 
   print "srcdir=$srcdir\n" if $verbose;
   chdir $srcdir || die "$me: cannot cd to $srcdir: $!\n";
 
-  open(CONF, ">configure.scan") ||
+  open (CONF, ">configure.scan") ||
     die "$me: cannot create configure.scan: $!\n";
 }
 
index b847dc78b02e1a13aeff1054341d140b2c4167e8..45f1ea983216ae6bfd2f6cc20151ba9e3be78938 100644 (file)
@@ -1,4 +1,4 @@
-#! @PERL@
+#! @PERL@ -w
 # autoscan - Create configure.scan (a preliminary configure.in) for a package.
 # Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 
@@ -20,6 +20,7 @@
 # Written by David MacKenzie <djm@gnu.ai.mit.edu>.
 
 require "find.pl";
+use Getopt::Long;
 
 $datadir = $ENV{"AC_MACRODIR"} || "@datadir@";
 ($me = $0) =~ s,.*/,,;
@@ -38,17 +39,14 @@ undef %programs_macros;
 
 exit 0;
 
-# Process any command line arguments.
-sub parse_args
+# Display usage (--help).
+sub print_usage
 {
-  # There are a couple of useless `\' below.  They are used to have
-  # Emacs fontify properly.
-  local ($usage) = <<EOD;
-Usage: $0 [OPTION] ... [SRCDIR]
+  print "Usage: $0 [OPTION] ... [SRCDIR]
 
 Examine source files in the directory tree rooted at SRCDIR, or the
 current directory if none is given.  Search the source files for
-common portability problems and create a file \`configure.scan' which
+common portability problems and create a file \`configure.scan\' which
 is a preliminary \`configure.in' for that package.
 
   -h, --help            print this help, then exit
@@ -59,61 +57,43 @@ Library directories:
   -A, --autoconf-dir=ACDIR  Autoconf's files location (rarely needed)
   -l, --localdir=DIR        location of \`aclocal.m4' and \`acconfig.h'
 
-Report bugs to <bug-autoconf\@gnu.org>.
-EOD
+Report bugs to <bug-autoconf\@gnu.org>.\n";
+  exit 0;
+}
 
-  local ($version) = <<'EOD';
-autoscan (GNU @PACKAGE@) @VERSION@
+# Display version (--version).
+sub print_version
+{
+  print "autoscan (GNU @PACKAGE@) @VERSION@
 Written by David J. MacKenzie.
 
 Copyright (C) 1994, 99, 2000 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-EOD
-
-  local ($help) = "Try \`$me --help' for more information.";
-
-  local $need_datadir = 0;
-
-  foreach $_ (@ARGV) {
-    if (/^--autoconf-dir=(.*)/) {
-      $datadir = $1;
-    } elsif (/^--autoconf-dir/ || /^-A$/) {
-      $need_datadir = 1;
-    } elsif (/^--m[a-z]*=(.*)/) {
-      $datadir = $1;
-    } elsif (/^-m$/) {
-      $need_datadir = 1;
-    } elsif (/^--h/ || /^-h$/) {
-      print "$usage";
-      exit 0;
-    } elsif (/^--verb/ || /^-v$/) {
-      $verbose = 1;
-    } elsif (/^--vers/ || /^-V$/) {
-      print "$version";
-      exit 0;
-    } elsif (/^[^-]/) {
-      if ($need_datadir) {
-       $datadir = $_;
-       $need_datadir = 0;
-      } else {
-       die "$me: too many arguments\n$help" if defined($srcdir);
-       # Top level directory of the package being autoscanned.
-       $srcdir = $_;
-      }
-    } else {
-      die "$me: invalid option $_\n$help";
-    }
-  }
-
-  die "$me: missing argument to -m\n$help" if $need_datadir;
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+  exit 0;
+}
 
-  $srcdir="." if !defined($srcdir);
+# Process any command line arguments.
+sub parse_args
+{
+  Getopt::Long::Configure ("bundling");
+  Getopt::Long::GetOptions ("A|autoconf-dir|m|macrodir=s" => \$datadir,
+                           "h|help" => \&print_usage,
+                           "V|version" => \&print_version,
+                           "v|verbose+" => \$verbose)
+    or exit 1;
+
+  die "$me: too many arguments
+Try \`$me --help' for more information.\n"
+    if (@ARGV > 1);
+  ($srcdir) = @ARGV;
+  $srcdir = "."
+    if !defined($srcdir);
 
   print "srcdir=$srcdir\n" if $verbose;
   chdir $srcdir || die "$me: cannot cd to $srcdir: $!\n";
 
-  open(CONF, ">configure.scan") ||
+  open (CONF, ">configure.scan") ||
     die "$me: cannot create configure.scan: $!\n";
 }
 
index a7979c01831c0e48b39f5fdb1c1da1cc3722a879..e667b2907e93b17adaf06ecaba8482950c638a26 100644 (file)
@@ -1,22 +1,33 @@
+# acidentifiers -- identifiers which are not involved in function calls.
+
+# Keywords.
+const          AC_C_CONST
+inline         AC_C_INLINE
+
+# Variables.
 sys_siglist    AC_DECL_SYS_SIGLIST
+
+# Types.
+gid_t          AC_TYPE_UID_T
 mode_t         AC_TYPE_MODE_T
 off_t          AC_TYPE_OFF_T
 pid_t          AC_TYPE_PID_T
 size_t         AC_TYPE_SIZE_T
+timeval                AC_HEADER_TIME
+tm             AC_STRUCT_TM
 uid_t          AC_TYPE_UID_T
-gid_t          AC_TYPE_UID_T
-S_ISDIR                AC_HEADER_STAT
-S_ISREG                AC_HEADER_STAT
-S_ISCHR                AC_HEADER_STAT
+
+# Macros.
 S_ISBLK                AC_HEADER_STAT
+S_ISCHR                AC_HEADER_STAT
+S_ISDIR                AC_HEADER_STAT
 S_ISFIFO       AC_HEADER_STAT
 S_ISLNK                AC_HEADER_STAT
+S_ISREG                AC_HEADER_STAT
 S_ISSOCK       AC_HEADER_STAT
+
+# Members of structures.
 st_blksize     AC_STRUCT_ST_BLKSIZE
 st_blocks      AC_STRUCT_ST_BLOCKS
 st_rdev                AC_STRUCT_ST_RDEV
-timeval                AC_HEADER_TIME
-tm             AC_STRUCT_TM
 tm_zone                AC_STRUCT_TIMEZONE
-const          AC_C_CONST
-inline         AC_C_INLINE