From: Akim Demaille Date: Tue, 1 Aug 2000 10:05:11 +0000 (+0000) Subject: * autoscan.pl: Use Getopt::Long; X-Git-Tag: autoconf-2.50~685 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d600514e0b72f9cc0c2be8645b3eb85a2095d5e;p=thirdparty%2Fautoconf.git * autoscan.pl: Use Getopt::Long; * acidentifiers: Classify, sort. --- diff --git a/ChangeLog b/ChangeLog index 4f93921f1..070c6e5af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-08-01 Akim Demaille + + * autoscan.pl: Use Getopt::Long; + * acidentifiers: Classify, sort. + 2000-08-01 Akim Demaille * aclang.m4 (_AC_PROG_CXX_GNU, _AC_PROG_CC_GNU, _AC_PROG_F77_GNU): diff --git a/acidentifiers b/acidentifiers index a7979c018..e667b2907 100644 --- a/acidentifiers +++ b/acidentifiers @@ -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 diff --git a/autoscan.in b/autoscan.in index b847dc78b..45f1ea983 100644 --- a/autoscan.in +++ b/autoscan.in @@ -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 . 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 +Report bugs to .\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"; } diff --git a/autoscan.pl b/autoscan.pl index b847dc78b..45f1ea983 100644 --- a/autoscan.pl +++ b/autoscan.pl @@ -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 . 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 +Report bugs to .\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"; } diff --git a/bin/autoscan.in b/bin/autoscan.in index b847dc78b..45f1ea983 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -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 . 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 +Report bugs to .\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"; } diff --git a/lib/autoscan/identifiers b/lib/autoscan/identifiers index a7979c018..e667b2907 100644 --- a/lib/autoscan/identifiers +++ b/lib/autoscan/identifiers @@ -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