From: Akim Demaille Date: Sat, 28 Sep 2002 14:03:14 +0000 (+0000) Subject: * bin/autoscan.in (@kinds): Make them singular. X-Git-Tag: AUTOCONF-2.54a~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dfa6d9aa30fae24abc477dc5200fef986f87dfc;p=thirdparty%2Fautoconf.git * bin/autoscan.in (@kinds): Make them singular. Adjust all uses. (&init_tables): When --debug, report the list of rules to ease tracking changes in autoscan.list. * lib/autoscan/autoscan.list (function): Strip comments, sort. --- diff --git a/ChangeLog b/ChangeLog index 5765103d0..9b096adb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-28 Akim Demaille + + * bin/autoscan.in (@kinds): Make them singular. + Adjust all uses. + (&init_tables): When --debug, report the list of rules to ease + tracking changes in autoscan.list. + * lib/autoscan/autoscan.list (function): Strip comments, sort. + 2002-09-28 Akim Demaille * lib/autoscan/functions, lib/autoscan/headers, diff --git a/bin/autoscan.in b/bin/autoscan.in index 875e1cf19..70f1006f1 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -38,25 +38,25 @@ use strict; use vars qw(@cfiles @makefiles @shfiles %printed); # The kind of the words we are looking for. -my @kinds = qw (functions headers identifiers programs - makevars libraries); +my @kinds = qw (function header identifier program + makevar librarie); # For each kind, the default macro. my %generic_macro = ( - 'functions' => 'AC_CHECK_FUNCS', - 'headers' => 'AC_CHECK_HEADERS', - 'identifiers' => 'AC_CHECK_TYPES', - 'programs' => 'AC_CHECK_PROGS', - 'libraries' => 'AC_CHECK_LIB' + 'function' => 'AC_CHECK_FUNCS', + 'header' => 'AC_CHECK_HEADERS', + 'identifier' => 'AC_CHECK_TYPES', + 'program' => 'AC_CHECK_PROGS', + 'library' => 'AC_CHECK_LIB' ); my %kind_comment = ( - 'functions' => 'Checks for library functions.', - 'headers' => 'Checks for header files.', - 'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.', - 'programs' => 'Checks for programs.', + 'function' => 'Checks for library functions.', + 'header' => 'Checks for header files.', + 'identifier' => 'Checks for typedefs, structures, and compiler characteristics.', + 'program' => 'Checks for programs.', ); # $USED{KIND}{ITEM} is the list of locations where the ITEM (of KIND) was used @@ -162,7 +162,7 @@ sub init_tables () # ': warn: '. if (/^(\S+):\s+(\S+)\s+(\S.*)$/) { - my ($kind, $word, $macro) = ("$1s", $2, $3); + my ($kind, $word, $macro) = ($1, $2, $3); error "$file:$.: invalid kind: $_" unless grep { $_ eq $kind } @kinds; push @{$macro{$kind}{$word}}, $macro; @@ -173,6 +173,17 @@ sub init_tables () } } + if ($debug) + { + foreach my $kind (@kinds) + { + foreach my $word (sort keys %{$macro{$kind}}) + { + print "$kind: $word: @{$macro{$kind}{$word}}\n"; + } + } + + } } @@ -186,7 +197,7 @@ sub used ($$;$) if ( # Check for all the libraries. But `-links' is certainly a # `find' argument, and `-le', a `test' argument. - ($kind eq 'libraries' && $word !~ /^(e|inks)$/) + ($kind eq 'library' && $word !~ /^(e|inks)$/) # Other than libraries are to be checked only if listed in # the Autoscan library files. || defined $macro{$kind}{$word} @@ -238,13 +249,13 @@ sub scan_c_file ($) { if (/^include\s*<([^>]*)>/) { - used ('headers', $1); + used ('header', $1); } if (s/^(if|ifdef|ifndef|elif)\s+//) { foreach my $word (split (/\W+/)) { - used ('identifiers', $word) + used ('identifier', $word) unless $word eq 'defined' || $word !~ /^[a-zA-Z_]/; } } @@ -260,11 +271,11 @@ sub scan_c_file ($) # Maybe we should ignore function definitions (in column 0)? while (s/\b([a-zA-Z_]\w*)\s*\(/ /) { - used ('functions', $1); + used ('function', $1); } while (s/\b([a-zA-Z_]\w*)\b/ /) { - used ('identifiers', $1); + used ('identifier', $1); } } @@ -289,7 +300,7 @@ sub scan_makefile ($) # Variable assignments. while (s/\b([a-zA-Z_]\w*)\s*=/ /) { - used ('makevars', $1); + used ('makevar', $1); } # Be sure to catch a whole word. For instance `lex$U.$(OBJEXT)' # is a single token. Otherwise we might believe `lex' is needed. @@ -298,14 +309,14 @@ sub scan_makefile ($) # Libraries. if ($word =~ /^-l([a-zA-Z_]\w*)$/) { - used ('libraries', $1); + used ('library', $1); } # Tokens in the code. # We allow some additional characters, e.g., `+', since # autoscan/programs includes `c++'. if ($word =~ /^[a-zA-Z_][\w+]*$/) { - used ('programs', $word); + used ('program', $word); } } } @@ -333,7 +344,7 @@ sub scan_sh_file ($) # Tokens in the code. while (s/\b([a-zA-Z_]\w*)\b/ /) { - used ('programs', $1); + used ('program', $1); } } @@ -359,12 +370,12 @@ sub scan_file () if (/\.[chlym](\.in)?$/) { - used 'programs', 'cc', $File::Find::name; + used 'program', 'cc', $File::Find::name; scan_c_file ($_); } elsif (/\.(cc|cpp|cxx|CC|C|hh|hpp|hxx|HH|H|yy|ypp|ll|lpp)(\.in)?$/) { - used 'programs', 'c++', $File::Find::name; + used 'program', 'c++', $File::Find::name; scan_c_file ($_); } elsif (/^[Mm]akefile(\.in)?$/ || /^GNUmakefile(\.in)?$/) @@ -466,7 +477,7 @@ sub output_libraries ($) my ($file) = @_; print $file "\n# Checks for libraries.\n"; - foreach my $word (sort keys %{$used{'libraries'}}) + foreach my $word (sort keys %{$used{'library'}}) { print $file "# FIXME: Replace `main' with a function in `-l$word':\n"; print $file "AC_CHECK_LIB([$word], [main])\n"; @@ -493,12 +504,12 @@ sub output ($) print $file "AC_CONFIG_HEADER([config.h])\n"; } - output_kind ($file, 'programs'); - output_kind ($file, 'makevars'); + output_kind ($file, 'program'); + output_kind ($file, 'makevar'); output_libraries ($file); - output_kind ($file, 'headers'); - output_kind ($file, 'identifiers'); - output_kind ($file, 'functions'); + output_kind ($file, 'header'); + output_kind ($file, 'identifier'); + output_kind ($file, 'function'); # Change DIR/Makefile.in to DIR/Makefile. foreach my $m (@makefiles) diff --git a/lib/autoscan/autoscan.list b/lib/autoscan/autoscan.list index 8ee53e9ee..f302520fb 100644 --- a/lib/autoscan/autoscan.list +++ b/lib/autoscan/autoscan.list @@ -1,4 +1,4 @@ -# autoscan's mapping to Autoconf macros +# autoscan's mapping to Autoconf macros -*- Makefile -*- # Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -17,125 +17,104 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -# Functions that have their own macros. -function: alloca AC_FUNC_ALLOCA -function: bcmp AC_HEADER_STDC -function: bcopy AC_HEADER_STDC -function: bzero AC_CHECK_FUNCS -function: bzero AC_HEADER_STDC -function: chown AC_FUNC_CHOWN -function: dcgettext AM_GNU_GETTEXT -function: error AC_FUNC_ERROR_AT_LINE -function: error_at_line AC_FUNC_ERROR_AT_LINE -function: fnmatch AC_FUNC_FNMATCH -function: fork AC_FUNC_FORK -function: fseeko AC_FUNC_FSEEKO -function: ftello AC_FUNC_FSEEKO -function: getgroups AC_FUNC_GETGROUPS -function: getloadavg AC_FUNC_GETLOADAVG -function: getpgrp AC_FUNC_GETPGRP -function: index AC_HEADER_STDC -function: ioctl AC_PROG_GCC_TRADITIONAL -function: lstat AC_FUNC_LSTAT -function: major AC_HEADER_MAJOR -function: makedev AC_HEADER_MAJOR -function: malloc AC_FUNC_MALLOC -function: mbrtowc AC_FUNC_MBRTOWC -function: memchr AC_CHECK_FUNCS -function: memchr AC_HEADER_STDC -function: memcmp AC_FUNC_MEMCMP -function: memcpy AC_HEADER_STDC -function: memmove AC_CHECK_FUNCS -function: memmove AC_HEADER_STDC -function: memset AC_CHECK_FUNCS -function: memset AC_HEADER_STDC -function: minor AC_HEADER_MAJOR -function: mktime AC_FUNC_MKTIME -function: mmap AC_FUNC_MMAP -function: obstack_init AC_FUNC_OBSTACK -function: realloc AC_FUNC_REALLOC -function: rindex AC_HEADER_STDC -function: setpgrp AC_FUNC_SETPGRP -function: setvbuf AC_FUNC_SETVBUF_REVERSED -function: signal AC_TYPE_SIGNAL -function: stat AC_FUNC_STAT -function: strcoll AC_FUNC_STRCOLL -function: strerror_r AC_FUNC_STRERROR_R -function: strftime AC_FUNC_STRFTIME -function: strnlen AC_FUNC_STRNLEN -function: strtod AC_FUNC_STRTOD -function: utime AC_CHECK_FUNCS -function: utime AC_FUNC_UTIME_NULL -function: vfork AC_FUNC_FORK -function: vfprintf AC_FUNC_VPRINTF -function: vprintf AC_FUNC_VPRINTF -function: vsprintf AC_FUNC_VPRINTF -function: wait3 AC_FUNC_WAIT3 - -# Functions we should no longer use. -function: getwd warn: getwd is deprecated, use getcwd instead - -# Functions checked with AC_CHECK_FUNCS. function: __argz_count AC_CHECK_FUNCS function: __argz_next AC_CHECK_FUNCS function: __argz_stringify AC_CHECK_FUNCS function: __fpending AC_CHECK_FUNCS function: acl AC_CHECK_FUNCS function: alarm AC_CHECK_FUNCS +function: alloca AC_FUNC_ALLOCA function: atexit AC_CHECK_FUNCS +function: bcmp AC_HEADER_STDC +function: bcopy AC_HEADER_STDC function: btowc AC_CHECK_FUNCS +function: bzero AC_CHECK_FUNCS +function: bzero AC_HEADER_STDC +function: chown AC_FUNC_CHOWN function: clock_gettime AC_CHECK_FUNCS +function: dcgettext AM_GNU_GETTEXT function: doprnt AC_CHECK_FUNCS function: dup2 AC_CHECK_FUNCS function: endgrent AC_CHECK_FUNCS function: endpwent AC_CHECK_FUNCS +function: error AC_FUNC_ERROR_AT_LINE +function: error_at_line AC_FUNC_ERROR_AT_LINE function: euidaccess AC_CHECK_FUNCS function: fchdir AC_CHECK_FUNCS function: fdatasync AC_CHECK_FUNCS function: fesetround AC_CHECK_FUNCS function: floor AC_CHECK_FUNCS +function: fnmatch AC_FUNC_FNMATCH +function: fork AC_FUNC_FORK function: fs_stat_dev AC_CHECK_FUNCS +function: fseeko AC_FUNC_FSEEKO +function: ftello AC_FUNC_FSEEKO function: ftime AC_CHECK_FUNCS function: ftruncate AC_CHECK_FUNCS function: getcwd AC_CHECK_FUNCS function: getdelim AC_CHECK_FUNCS +function: getgroups AC_FUNC_GETGROUPS function: gethostbyaddr AC_CHECK_FUNCS function: gethostbyname AC_CHECK_FUNCS function: gethostname AC_CHECK_FUNCS function: gethrtime AC_CHECK_FUNCS +function: getloadavg AC_FUNC_GETLOADAVG function: getmntent AC_CHECK_FUNCS function: getmntinfo AC_CHECK_FUNCS function: getpagesize AC_CHECK_FUNCS function: getpass AC_CHECK_FUNCS +function: getpgrp AC_FUNC_GETPGRP function: getspnam AC_CHECK_FUNCS function: gettimeofday AC_CHECK_FUNCS function: getusershell AC_CHECK_FUNCS +function: getwd warn: getwd is deprecated, use getcwd instead function: hasmntopt AC_CHECK_FUNCS +function: index AC_HEADER_STDC function: inet_ntoa AC_CHECK_FUNCS +function: ioctl AC_PROG_GCC_TRADITIONAL function: isascii AC_CHECK_FUNCS function: iswprint AC_CHECK_FUNCS function: lchown AC_CHECK_FUNCS function: listmntent AC_CHECK_FUNCS function: localeconv AC_CHECK_FUNCS function: localtime_r AC_CHECK_FUNCS +function: lstat AC_FUNC_LSTAT +function: major AC_HEADER_MAJOR +function: makedev AC_HEADER_MAJOR +function: malloc AC_FUNC_MALLOC function: mblen AC_CHECK_FUNCS function: mbrlen AC_CHECK_FUNCS +function: mbrtowc AC_FUNC_MBRTOWC +function: memchr AC_CHECK_FUNCS +function: memchr AC_HEADER_STDC +function: memcmp AC_FUNC_MEMCMP +function: memcpy AC_HEADER_STDC +function: memmove AC_CHECK_FUNCS +function: memmove AC_HEADER_STDC function: mempcpy AC_CHECK_FUNCS +function: memset AC_CHECK_FUNCS +function: memset AC_HEADER_STDC +function: minor AC_HEADER_MAJOR function: mkdir AC_CHECK_FUNCS function: mkfifo AC_CHECK_FUNCS +function: mktime AC_FUNC_MKTIME +function: mmap AC_FUNC_MMAP function: modf AC_CHECK_FUNCS function: munmap AC_CHECK_FUNCS function: next_dev AC_CHECK_FUNCS function: nl_langinfo AC_CHECK_FUNCS +function: obstack_init AC_FUNC_OBSTACK function: pathconf AC_CHECK_FUNCS function: pow AC_CHECK_FUNCS function: pstat_getdynamic AC_CHECK_FUNCS function: putenv AC_CHECK_FUNCS function: re_comp AC_CHECK_FUNCS +function: realloc AC_FUNC_REALLOC function: realpath AC_CHECK_FUNCS function: regcmp AC_CHECK_FUNCS function: regcomp AC_CHECK_FUNCS function: resolvepath AC_CHECK_FUNCS +function: rindex AC_HEADER_STDC function: rint AC_CHECK_FUNCS function: rmdir AC_CHECK_FUNCS function: rpmatch AC_CHECK_FUNCS @@ -143,21 +122,30 @@ function: select AC_CHECK_FUNCS function: setenv AC_CHECK_FUNCS function: sethostname AC_CHECK_FUNCS function: setlocale AC_CHECK_FUNCS +function: setpgrp AC_FUNC_SETPGRP +function: setvbuf AC_FUNC_SETVBUF_REVERSED +function: signal AC_TYPE_SIGNAL function: socket AC_CHECK_FUNCS function: sqrt AC_CHECK_FUNCS +function: stat AC_FUNC_STAT function: stime AC_CHECK_FUNCS function: stpcpy AC_CHECK_FUNCS function: strcasecmp AC_CHECK_FUNCS function: strchr AC_CHECK_FUNCS +function: strcoll AC_FUNC_STRCOLL function: strcspn AC_CHECK_FUNCS function: strdup AC_CHECK_FUNCS function: strerror AC_CHECK_FUNCS +function: strerror_r AC_FUNC_STRERROR_R +function: strftime AC_FUNC_STRFTIME function: strncasecmp AC_CHECK_FUNCS function: strndup AC_CHECK_FUNCS +function: strnlen AC_FUNC_STRNLEN function: strpbrk AC_CHECK_FUNCS function: strrchr AC_CHECK_FUNCS function: strspn AC_CHECK_FUNCS function: strstr AC_CHECK_FUNCS +function: strtod AC_FUNC_STRTOD function: strtol AC_CHECK_FUNCS function: strtoul AC_CHECK_FUNCS function: strtoull AC_CHECK_FUNCS @@ -166,37 +154,26 @@ function: strverscmp AC_CHECK_FUNCS function: sysinfo AC_CHECK_FUNCS function: tzset AC_CHECK_FUNCS function: uname AC_CHECK_FUNCS +function: utime AC_CHECK_FUNCS +function: utime AC_FUNC_UTIME_NULL function: utmpname AC_CHECK_FUNCS function: utmpxname AC_CHECK_FUNCS +function: vfork AC_FUNC_FORK +function: vfprintf AC_FUNC_VPRINTF +function: vprintf AC_FUNC_VPRINTF +function: vsprintf AC_FUNC_VPRINTF +function: wait3 AC_FUNC_WAIT3 function: wcwidth AC_CHECK_FUNCS - -# Headers with specific macros. +header: OS.h AC_CHECK_HEADERS header: X11/Xlib.h AC_PATH_X header: alloca.h AC_FUNC_ALLOCA -header: dirent.h AC_HEADER_DIRENT -header: float.h AC_CHECK_HEADERS -header: float.h AC_HEADER_STDC -header: ndir.h AC_HEADER_DIRENT -header: stdarg.h AC_HEADER_STDC -header: stddef.h AC_CHECK_HEADERS -header: stddef.h AC_HEADER_STDC -header: stdlib.h AC_CHECK_HEADERS -header: stdlib.h AC_HEADER_STDC -header: string.h AC_CHECK_HEADERS -header: string.h AC_HEADER_STDC -header: sys/dir.h AC_HEADER_DIRENT -header: sys/mkdev.h AC_HEADER_MAJOR -header: sys/ndir.h AC_HEADER_DIRENT -header: sys/wait.h AC_HEADER_SYS_WAIT - -# Others, checked with AC_CHECK_HEADERS. -header: OS.h AC_CHECK_HEADERS header: argz.h AC_CHECK_HEADERS header: arpa/inet.h AC_CHECK_HEADERS - -# errno.h is portable. +header: dirent.h AC_HEADER_DIRENT header: fcntl.h AC_CHECK_HEADERS header: fenv.h AC_CHECK_HEADERS +header: float.h AC_CHECK_HEADERS +header: float.h AC_HEADER_STDC header: fs_info.h AC_CHECK_HEADERS header: inttypes.h AC_CHECK_HEADERS header: langinfo.h AC_CHECK_HEADERS @@ -208,6 +185,7 @@ header: malloc.h AC_CHECK_HEADERS header: memory.h AC_CHECK_HEADERS header: mntent.h AC_CHECK_HEADERS header: mnttab.h AC_CHECK_HEADERS +header: ndir.h AC_HEADER_DIRENT header: netdb.h AC_CHECK_HEADERS header: netinet/in.h AC_CHECK_HEADERS header: nl_types.h AC_CHECK_HEADERS @@ -215,18 +193,28 @@ header: nlist.h AC_CHECK_HEADERS header: paths.h AC_CHECK_HEADERS header: sgtty.h AC_CHECK_HEADERS header: shadow.h AC_CHECK_HEADERS +header: stdarg.h AC_HEADER_STDC +header: stddef.h AC_CHECK_HEADERS +header: stddef.h AC_HEADER_STDC header: stdint.h AC_CHECK_HEADERS header: stdio_ext.h AC_CHECK_HEADERS +header: stdlib.h AC_CHECK_HEADERS +header: stdlib.h AC_HEADER_STDC +header: string.h AC_CHECK_HEADERS +header: string.h AC_HEADER_STDC header: strings.h AC_CHECK_HEADERS header: sys/acl.h AC_CHECK_HEADERS +header: sys/dir.h AC_HEADER_DIRENT header: sys/file.h AC_CHECK_HEADERS header: sys/filsys.h AC_CHECK_HEADERS header: sys/fs/s5param.h AC_CHECK_HEADERS header: sys/fs_types.h AC_CHECK_HEADERS header: sys/fstyp.h AC_CHECK_HEADERS header: sys/ioctl.h AC_CHECK_HEADERS +header: sys/mkdev.h AC_HEADER_MAJOR header: sys/mntent.h AC_CHECK_HEADERS header: sys/mount.h AC_CHECK_HEADERS +header: sys/ndir.h AC_HEADER_DIRENT header: sys/param.h AC_CHECK_HEADERS header: sys/socket.h AC_CHECK_HEADERS header: sys/statfs.h AC_CHECK_HEADERS @@ -235,6 +223,7 @@ header: sys/systeminfo.h AC_CHECK_HEADERS header: sys/time.h AC_CHECK_HEADERS header: sys/timeb.h AC_CHECK_HEADERS header: sys/vfs.h AC_CHECK_HEADERS +header: sys/wait.h AC_HEADER_SYS_WAIT header: sys/window.h AC_CHECK_HEADERS header: syslog.h AC_CHECK_HEADERS header: termio.h AC_CHECK_HEADERS @@ -246,41 +235,30 @@ header: utmpx.h AC_CHECK_HEADERS header: values.h AC_CHECK_HEADERS header: wchar.h AC_CHECK_HEADERS header: wctype.h AC_CHECK_HEADERS - -# Keywords. +identifier: S_ISBLK AC_HEADER_STAT +identifier: S_ISCHR AC_HEADER_STAT +identifier: S_ISDIR AC_HEADER_STAT +identifier: S_ISFIFO AC_HEADER_STAT +identifier: S_ISLNK AC_HEADER_STAT +identifier: S_ISREG AC_HEADER_STAT +identifier: S_ISSOCK AC_HEADER_STAT identifier: const AC_C_CONST -identifier: inline AC_C_INLINE - -# Variables. -identifier: sys_siglist AC_DECL_SYS_SIGLIST - -# Types. identifier: gid_t AC_TYPE_UID_T +identifier: inline AC_C_INLINE identifier: mode_t AC_TYPE_MODE_T identifier: obstack AC_FUNC_OBSTACK identifier: off_t AC_TYPE_OFF_T identifier: pid_t AC_TYPE_PID_T identifier: ptrdiff_t AC_CHECK_TYPES identifier: size_t AC_TYPE_SIZE_T -identifier: timeval AC_HEADER_TIME -identifier: tm AC_STRUCT_TM -identifier: uid_t AC_TYPE_UID_T - -# Macros. -identifier: S_ISBLK AC_HEADER_STAT -identifier: S_ISCHR AC_HEADER_STAT -identifier: S_ISDIR AC_HEADER_STAT -identifier: S_ISFIFO AC_HEADER_STAT -identifier: S_ISLNK AC_HEADER_STAT -identifier: S_ISREG AC_HEADER_STAT -identifier: S_ISSOCK AC_HEADER_STAT - -# Members of structures. identifier: st_blksize AC_CHECK_MEMBERS([struct stat.st_blksize]) identifier: st_blocks AC_STRUCT_ST_BLOCKS identifier: st_rdev AC_CHECK_MEMBERS([struct stat.st_rdev]) +identifier: sys_siglist AC_DECL_SYS_SIGLIST +identifier: timeval AC_HEADER_TIME +identifier: tm AC_STRUCT_TM identifier: tm_zone AC_STRUCT_TIMEZONE - +identifier: uid_t AC_TYPE_UID_T makevar: AWK AC_PROG_AWK makevar: BISON AC_PROG_YACC makevar: CC AC_PROG_CC @@ -292,7 +270,6 @@ makevar: LN AC_PROG_LN_S makevar: MAKE AC_PROG_MAKE_SET makevar: RANLIB AC_PROG_RANLIB makevar: YACC AC_PROG_YACC - program: CC AC_PROG_CXX program: awk AC_PROG_AWK program: bison AC_PROG_YACC @@ -312,8 +289,3 @@ program: mawk AC_PROG_AWK program: nawk AC_PROG_AWK program: ranlib AC_PROG_RANLIB program: yacc AC_PROG_YACC - - -# Local Variables: -# mode: shell-script -# End: