]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Initial revision
authorDavid MacKenzie <djm@djmnet.org>
Sat, 30 Apr 1994 01:42:39 +0000 (01:42 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Sat, 30 Apr 1994 01:42:39 +0000 (01:42 +0000)
16 files changed:
acfunctions [new file with mode: 0644]
acheaders [new file with mode: 0644]
acidentifiers [new file with mode: 0644]
acmakevars [new file with mode: 0644]
acprograms [new file with mode: 0644]
autoreconf.in [new file with mode: 0644]
autoreconf.sh [new file with mode: 0644]
autoscan.in [new file with mode: 0644]
autoscan.pl [new file with mode: 0644]
bin/autoreconf.in [new file with mode: 0644]
bin/autoscan.in [new file with mode: 0644]
lib/autoscan/functions [new file with mode: 0644]
lib/autoscan/headers [new file with mode: 0644]
lib/autoscan/identifiers [new file with mode: 0644]
lib/autoscan/makevars [new file with mode: 0644]
lib/autoscan/programs [new file with mode: 0644]

diff --git a/acfunctions b/acfunctions
new file mode 100644 (file)
index 0000000..ef4d7e9
--- /dev/null
@@ -0,0 +1,58 @@
+# Ones that have their own macros.
+major          AC_MAJOR_HEADER
+minor          AC_MAJOR_HEADER
+makedev                AC_MAJOR_HEADER
+bcopy          AC_STDC_HEADERS
+bcmp           AC_STDC_HEADERS
+bzero          AC_STDC_HEADERS
+ioctl          AC_GCC_TRADITIONAL
+memchr         AC_STDC_HEADERS
+memcpy         AC_STDC_HEADERS
+memcmp         AC_STDC_HEADERS
+memmove                AC_STDC_HEADERS
+memset         AC_STDC_HEADERS
+index          AC_STDC_HEADERS
+rindex         AC_STDC_HEADERS
+getgroups      AC_GETGROUPS_T
+signal         AC_RETSIGTYPE
+alloca         AC_ALLOCA
+getloadavg     AC_GETLOADAVG
+mmap           AC_MMAP
+setvbuf                AC_SETVBUF_REVERSED
+strcoll                AC_STRCOLL
+utime          AC_UTIME_NULL
+vfork          AC_VFORK
+vprintf                AC_VPRINTF
+vfprintf       AC_VPRINTF
+vsprintf       AC_VPRINTF
+wait3          AC_WAIT3
+
+# Others.
+fnmatch                AC_HAVE_FUNCS
+ftime          AC_HAVE_FUNCS
+gethostname    AC_HAVE_FUNCS
+gettimeofday   AC_HAVE_FUNCS
+getusershell   AC_HAVE_FUNCS
+getcwd         AC_HAVE_FUNCS
+getwd          AC_HAVE_FUNCS
+mkdir          AC_HAVE_FUNCS
+mkfifo         AC_HAVE_FUNCS
+mktime         AC_HAVE_FUNCS
+putenv         AC_HAVE_FUNCS
+re_comp                AC_HAVE_FUNCS
+regcmp         AC_HAVE_FUNCS
+regcomp                AC_HAVE_FUNCS
+rmdir          AC_HAVE_FUNCS
+select         AC_HAVE_FUNCS
+socket         AC_HAVE_FUNCS
+stime          AC_HAVE_FUNCS
+strcspn                AC_HAVE_FUNCS
+strdup         AC_HAVE_FUNCS
+strerror       AC_HAVE_FUNCS
+strftime       AC_HAVE_FUNCS
+strspn         AC_HAVE_FUNCS
+strstr         AC_HAVE_FUNCS
+strtod         AC_HAVE_FUNCS
+strtol         AC_HAVE_FUNCS
+strtoul                AC_HAVE_FUNCS
+uname          AC_HAVE_FUNCS
diff --git a/acheaders b/acheaders
new file mode 100644 (file)
index 0000000..398f864
--- /dev/null
+++ b/acheaders
@@ -0,0 +1,27 @@
+# Ones that have their own macros.
+dirent.h       AC_DIR_HEADER
+sys/ndir.h     AC_DIR_HEADER
+sys/dir.h      AC_DIR_HEADER
+ndir.h         AC_DIR_HEADER
+sys/mkdev.h    AC_MAJOR_HEADER
+string.h       AC_STDC_HEADERS
+strings.h      AC_STDC_HEADERS
+stdlib.h       AC_STDC_HEADERS
+stddef.h       AC_STDC_HEADERS
+stdarg.h       AC_STDC_HEADERS
+float.h                AC_STDC_HEADERS
+sys/mtio.h     AC_REMOTE_TAPE
+X11/Xlib.h     AC_FIND_X
+
+# Others.
+fcntl.h                AC_HAVE_HEADERS
+limits.h       AC_HAVE_HEADERS
+paths.h                AC_HAVE_HEADERS
+sgtty.h                AC_HAVE_HEADERS
+sys/file.h     AC_HAVE_HEADERS
+sys/ioctl.h    AC_HAVE_HEADERS
+sys/time.h     AC_HAVE_HEADERS
+sys/window.h   AC_HAVE_HEADERS
+syslog.h       AC_HAVE_HEADERS
+termio.h       AC_HAVE_HEADERS
+unistd.h       AC_HAVE_HEADERS
diff --git a/acidentifiers b/acidentifiers
new file mode 100644 (file)
index 0000000..d200c61
--- /dev/null
@@ -0,0 +1,22 @@
+sys_siglist    AC_SYS_SIGLIST_DECLARED
+mode_t         AC_MODE_T
+off_t          AC_OFF_T
+pid_t          AC_PID_T
+size_t         AC_SIZE_T
+uid_t          AC_UID_T
+gid_t          AC_UID_T
+S_ISDIR                AC_STAT_MACROS_BROKEN
+S_ISREG                AC_STAT_MACROS_BROKEN
+S_ISCHR                AC_STAT_MACROS_BROKEN
+S_ISBLK                AC_STAT_MACROS_BROKEN
+S_ISFIFO       AC_STAT_MACROS_BROKEN
+S_ISLNK                AC_STAT_MACROS_BROKEN
+S_ISSOCK       AC_STAT_MACROS_BROKEN
+st_blksize     AC_ST_BLKSIZE
+st_blocks      AC_ST_BLOCKS
+st_rdev                AC_ST_RDEV
+timeval                AC_TIME_WITH_SYS_TIME
+tm             AC_STRUCT_TM
+tm_zone                AC_TIMEZONE
+const          AC_CONST
+inline         AC_INLINE
diff --git a/acmakevars b/acmakevars
new file mode 100644 (file)
index 0000000..7b33b87
--- /dev/null
@@ -0,0 +1,11 @@
+LN             AC_LN_S
+AWK            AC_PROG_AWK
+CC             AC_PROG_CC
+CPP            AC_PROG_CPP
+CXX            AC_PROG_CXX
+INSTALL                AC_PROG_INSTALL
+LEX            AC_PROG_LEX
+RANLIB         AC_PROG_RANLIB
+YACC           AC_PROG_YACC
+BISON          AC_PROG_YACC
+MAKE           AC_SET_MAKE
diff --git a/acprograms b/acprograms
new file mode 100644 (file)
index 0000000..d61f9db
--- /dev/null
@@ -0,0 +1,18 @@
+ln             AC_LN_S
+awk            AC_PROG_AWK
+nawk           AC_PROG_AWK
+gawk           AC_PROG_AWK
+mawk           AC_PROG_AWK
+cc             AC_PROG_CC
+gcc            AC_PROG_CC
+cpp            AC_PROG_CPP
+CC             AC_PROG_CXX
+g++            AC_PROG_CXX
+install                AC_PROG_INSTALL
+lex            AC_PROG_LEX
+flex           AC_PROG_LEX
+ranlib         AC_PROG_RANLIB
+yacc           AC_PROG_YACC
+byacc          AC_PROG_YACC
+bison          AC_PROG_YACC
+make           AC_SET_MAKE
diff --git a/autoreconf.in b/autoreconf.in
new file mode 100644 (file)
index 0000000..87dbb55
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+# autoreconf - remake all Autoconf configure scripts in a directory tree
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+if test $# -eq 0; then paths=.; else paths="$@"; fi
+
+# The xargs grep filters out Cygnus configure.in files.
+find $paths -name configure.in -print |
+xargs grep -l AC_OUTPUT |
+while read confin; do
+  (
+  dir=`echo $confin|sed 's%/[^/][^/]*$%%'`
+  cd $dir || exit 1
+  echo running autoconf in $dir
+  autoconf
+  if grep AC_CONFIG_HEADER configure.in > /dev/null; then
+    echo running autoheader in $dir
+    autoheader
+  fi
+  )
+done
+
diff --git a/autoreconf.sh b/autoreconf.sh
new file mode 100644 (file)
index 0000000..87dbb55
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+# autoreconf - remake all Autoconf configure scripts in a directory tree
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+if test $# -eq 0; then paths=.; else paths="$@"; fi
+
+# The xargs grep filters out Cygnus configure.in files.
+find $paths -name configure.in -print |
+xargs grep -l AC_OUTPUT |
+while read confin; do
+  (
+  dir=`echo $confin|sed 's%/[^/][^/]*$%%'`
+  cd $dir || exit 1
+  echo running autoconf in $dir
+  autoconf
+  if grep AC_CONFIG_HEADER configure.in > /dev/null; then
+    echo running autoheader in $dir
+    autoheader
+  fi
+  )
+done
+
diff --git a/autoscan.in b/autoscan.in
new file mode 100644 (file)
index 0000000..cbae762
--- /dev/null
@@ -0,0 +1,389 @@
+#!@PERL@
+eval "exec @PERL@ -S $0 $*"
+    if $running_under_some_shell;
+                        # this emulates #! processing on NIH machines.
+                        # (remove #! line above if indigestible)
+
+# autoscan - Create configure.scan (a preliminary configure.in) for a package.
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+require "find.pl";
+
+$datadir = "@datadir@";
+$verbose = 0;
+
+&parse_args;
+&init_tables;
+&find('.');
+&scan_files;
+&output;
+
+exit 0;
+
+# Process any command line arguments.
+sub parse_args
+{
+    local ($usage) = "Usage: $0 [--help] [--verbose] [--version] [srcdir]\n"; 
+
+    foreach $_ (@ARGV) {
+       if (/^--h/) {
+           print "$usage";
+           exit 0;
+       } elsif (/^--verb/) {
+           $verbose = 1;
+       } elsif (/^--vers/) {
+           &version;
+       } elsif (/^[^-]/) {
+           die "$usage" if defined($srcdir);
+           # Top level directory of the package being autoscanned.
+           $srcdir = $_;
+       } else {
+           die "$usage";
+       }
+    }
+
+    $srcdir="." if !defined($srcdir);
+
+    print "srcdir=$srcdir\n" if $verbose;
+    chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n";
+
+    open(CONF, ">configure.scan") ||
+       die "$0: cannot create configure.scan: $!\n";
+}
+
+# Print the version number and exit.
+sub version
+{
+    open(ACG, "<$datadir/acgeneral.m4") ||
+       die "$0: cannot open $datadir/acgeneral.m4: $!\n";
+    while (<ACG>) {
+       if (/define.AC_ACVERSION.\s*([0-9.]+)/) {
+           print "Autoconf version $1\n";
+           exit 0;
+       }
+    }
+    die "Autoconf version unknown\n";
+}
+
+# Put values in the tables of what to do with each token.
+sub init_tables
+{
+    local($kind, $word, $macro, %files);
+
+    # Initialize a table of C keywords (to ignore).
+    # Taken from K&R 1st edition p. 180.
+    # ANSI C, GNU C, and C++ keywords can introduce portability problems,
+    # so don't ignore them.
+    foreach $word ('int', 'char', 'float', 'double', 'struct', 'union',
+                  'long', 'short', 'unsigned', 'auto', 'extern', 'register',
+                  'typedef', 'static', 'goto', 'return', 'sizeof', 'break',
+                  'continue', 'if', 'else', 'for', 'do', 'while', 'switch',
+                  'case', 'default') {
+       $c_keywords{$word} = 0;
+    }
+
+    # The data file format supports only one line of macros per function.
+    # If more than that is required for a common portability problem,
+    # a new Autoconf macro should probably be written for that case,
+    # instead of duplicating the code in lots of configure.in files.
+
+    foreach $kind ('functions', 'headers', 'identifiers', 'programs',
+                  'makevars') {
+       open(TABLE, "<$datadir/ac$kind") ||
+           die "$0: cannot open $datadir/ac$kind: $!\n";
+       while (<TABLE>) {
+           next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
+           ($word, $macro) = split;
+           eval "\$$kind" . "_macros{\$word} = \$macro";
+       }
+       close(TABLE);
+    }
+}
+
+# Collect names of various kinds of files in the package.
+# Called by &find on each file.
+sub wanted
+{
+    if (/^.*\.[chlymC]$/ || /^.*\.cc$/) {
+       $name =~ s?^\./??; push(@cfiles, $name);
+    }
+    elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) {
+       $name =~ s?^\./??; push(@makefiles, $name);
+    }
+    elsif (/^.*\.sh$/) {
+       $name =~ s?^\./??; push(@shfiles, $name);
+    }
+}
+
+# Read through the files and collect lists of tokens in them
+# that might create nonportabilities.
+sub scan_files
+{
+    $initfile = $cfiles[0];            # Pick one at random.
+
+    if ($verbose) {
+       print "cfiles:", join(" ", @cfiles), "\n";
+       print "makefiles:", join(" ", @makefiles), "\n";
+       print "shfiles:", join(" ", @shfiles), "\n";
+    }
+
+    foreach $file (@cfiles) {
+       &scan_c_file($file);
+    }
+
+    foreach $file (@makefiles) {
+       &scan_makefile($file);
+    }
+
+    foreach $file (@shfiles) {
+       &scan_sh_file($file);
+    }
+}
+
+sub scan_c_file
+{
+    local($file) = @_;
+    local($in_comment) = 0;    # Nonzero if in a multiline comment.
+
+    open(CFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<CFILE>) {
+       # Strip out comments, approximately.
+       # Ending on this line.
+       if ($in_comment && m,\*/,) {
+           s,.*\*/,,;
+           $in_comment = 0;
+       }
+       # All on one line.
+       s,/\*.*\*/,,g;
+       # Starting on this line.
+       if (m,/\*,) {
+           $in_comment = 1;
+       }
+       # Continuing on this line.
+       next if $in_comment;
+
+       # Preprocessor directives.
+       if (/^\s*#\s*include\s*<([^>]*)>/) {
+           $headers{$1}++;
+       }
+       # Ignore other preprocessor directives.
+       next if /^\s*#/;
+
+       # Remove string and character constants.
+       s,\"[^\"]*\",,g;
+        s,\'[^\']*\',,g;
+
+       # Tokens in the code.
+       # Maybe we should ignore function definitions (in column 0)?
+       while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+           $functions{$1}++ if !defined($c_keywords{$1});
+       }
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $identifiers{$1}++ if !defined($c_keywords{$1});
+       }
+    }
+    close(CFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file functions:\n";
+       foreach $word (sort keys %functions) {
+           print "$word $functions{$word}\n";
+       }
+
+       print "\n$file identifiers:\n";
+       foreach $word (sort keys %identifiers) {
+           print "$word $identifiers{$word}\n";
+       }
+
+       print "\n$file headers:\n";
+       foreach $word (sort keys %headers) {
+           print "$word $headers{$word}\n";
+       }
+    }
+}
+
+sub scan_makefile
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\$\([^\)]*\)//g;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Variable assignments.
+       while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+           $makevars{$1}++;
+       }
+       # Libraries.
+       while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+           $libraries{$1}++;
+       }
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file makevars:\n";
+       foreach $word (sort keys %makevars) {
+           print "$word $makevars{$word}\n";
+       }
+
+       print "\n$file libraries:\n";
+       foreach $word (sort keys %libraries) {
+           print "$word $libraries{$word}\n";
+       }
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+sub scan_sh_file
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+# Print a configure.in.
+sub output
+{
+    local (%unique_makefiles);
+
+    print CONF "dnl Process this file with autoconf to produce a configure script.\n";
+    print CONF "AC_INIT($initfile)\n";
+
+    &output_programs;
+    &output_headers;
+    &output_identifiers;
+    &output_functions;
+
+    # Change DIR/Makefile.in to DIR/Makefile.
+    foreach $_ (@makefiles) {
+       s/\.in$//;
+       $unique_makefiles{$_}++;
+    }
+    print CONF "AC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n";
+
+    close CONF;
+}
+
+# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
+sub print_unique
+{
+    local($macro) = @_;
+
+    if (defined($macro) && !defined($printed{$macro})) {
+       print CONF "$macro\n";
+       $printed{$macro} = 1;
+    }
+}
+
+sub output_programs
+{
+    local ($word);
+
+    print CONF "dnl Checks for programs.\n";
+    foreach $word (sort keys %programs) {
+       &print_unique($programs_macros{$word});
+    }
+    foreach $word (sort keys %makevars) {
+       &print_unique($makevars_macros{$word});
+    }
+    print CONF "dnl Checks for libraries.\n";
+    foreach $word (sort keys %libraries) {
+       print CONF "AC_HAVE_LIBRARY($word)\n";
+    }
+}
+
+sub output_headers
+{
+    local ($word);
+
+    print CONF "dnl Checks for header files.\n";
+    foreach $word (sort keys %headers) {
+       if ($headers_macros{$word} eq 'AC_HAVE_HEADERS') {
+           push(@have_headers, $word);
+       } else {        
+           &print_unique($headers_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_HEADERS(" . join(' ', sort(@have_headers)) . ")\n"
+       if defined(@have_headers);
+}
+
+sub output_identifiers
+{
+    local ($word);
+
+    print CONF "dnl Checks for identifiers.\n";
+    foreach $word (sort keys %identifiers) {
+       &print_unique($identifiers_macros{$word});
+    }
+}
+
+sub output_functions
+{
+    local ($word);
+
+    print CONF "dnl Checks for functions.\n";
+    foreach $word (sort keys %functions) {
+       if ($functions_macros{$word} eq 'AC_HAVE_FUNCS') {
+           push(@have_funcs, $word);
+       } else {        
+           &print_unique($functions_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n"
+       if defined(@have_funcs);
+}
diff --git a/autoscan.pl b/autoscan.pl
new file mode 100644 (file)
index 0000000..cbae762
--- /dev/null
@@ -0,0 +1,389 @@
+#!@PERL@
+eval "exec @PERL@ -S $0 $*"
+    if $running_under_some_shell;
+                        # this emulates #! processing on NIH machines.
+                        # (remove #! line above if indigestible)
+
+# autoscan - Create configure.scan (a preliminary configure.in) for a package.
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+require "find.pl";
+
+$datadir = "@datadir@";
+$verbose = 0;
+
+&parse_args;
+&init_tables;
+&find('.');
+&scan_files;
+&output;
+
+exit 0;
+
+# Process any command line arguments.
+sub parse_args
+{
+    local ($usage) = "Usage: $0 [--help] [--verbose] [--version] [srcdir]\n"; 
+
+    foreach $_ (@ARGV) {
+       if (/^--h/) {
+           print "$usage";
+           exit 0;
+       } elsif (/^--verb/) {
+           $verbose = 1;
+       } elsif (/^--vers/) {
+           &version;
+       } elsif (/^[^-]/) {
+           die "$usage" if defined($srcdir);
+           # Top level directory of the package being autoscanned.
+           $srcdir = $_;
+       } else {
+           die "$usage";
+       }
+    }
+
+    $srcdir="." if !defined($srcdir);
+
+    print "srcdir=$srcdir\n" if $verbose;
+    chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n";
+
+    open(CONF, ">configure.scan") ||
+       die "$0: cannot create configure.scan: $!\n";
+}
+
+# Print the version number and exit.
+sub version
+{
+    open(ACG, "<$datadir/acgeneral.m4") ||
+       die "$0: cannot open $datadir/acgeneral.m4: $!\n";
+    while (<ACG>) {
+       if (/define.AC_ACVERSION.\s*([0-9.]+)/) {
+           print "Autoconf version $1\n";
+           exit 0;
+       }
+    }
+    die "Autoconf version unknown\n";
+}
+
+# Put values in the tables of what to do with each token.
+sub init_tables
+{
+    local($kind, $word, $macro, %files);
+
+    # Initialize a table of C keywords (to ignore).
+    # Taken from K&R 1st edition p. 180.
+    # ANSI C, GNU C, and C++ keywords can introduce portability problems,
+    # so don't ignore them.
+    foreach $word ('int', 'char', 'float', 'double', 'struct', 'union',
+                  'long', 'short', 'unsigned', 'auto', 'extern', 'register',
+                  'typedef', 'static', 'goto', 'return', 'sizeof', 'break',
+                  'continue', 'if', 'else', 'for', 'do', 'while', 'switch',
+                  'case', 'default') {
+       $c_keywords{$word} = 0;
+    }
+
+    # The data file format supports only one line of macros per function.
+    # If more than that is required for a common portability problem,
+    # a new Autoconf macro should probably be written for that case,
+    # instead of duplicating the code in lots of configure.in files.
+
+    foreach $kind ('functions', 'headers', 'identifiers', 'programs',
+                  'makevars') {
+       open(TABLE, "<$datadir/ac$kind") ||
+           die "$0: cannot open $datadir/ac$kind: $!\n";
+       while (<TABLE>) {
+           next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
+           ($word, $macro) = split;
+           eval "\$$kind" . "_macros{\$word} = \$macro";
+       }
+       close(TABLE);
+    }
+}
+
+# Collect names of various kinds of files in the package.
+# Called by &find on each file.
+sub wanted
+{
+    if (/^.*\.[chlymC]$/ || /^.*\.cc$/) {
+       $name =~ s?^\./??; push(@cfiles, $name);
+    }
+    elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) {
+       $name =~ s?^\./??; push(@makefiles, $name);
+    }
+    elsif (/^.*\.sh$/) {
+       $name =~ s?^\./??; push(@shfiles, $name);
+    }
+}
+
+# Read through the files and collect lists of tokens in them
+# that might create nonportabilities.
+sub scan_files
+{
+    $initfile = $cfiles[0];            # Pick one at random.
+
+    if ($verbose) {
+       print "cfiles:", join(" ", @cfiles), "\n";
+       print "makefiles:", join(" ", @makefiles), "\n";
+       print "shfiles:", join(" ", @shfiles), "\n";
+    }
+
+    foreach $file (@cfiles) {
+       &scan_c_file($file);
+    }
+
+    foreach $file (@makefiles) {
+       &scan_makefile($file);
+    }
+
+    foreach $file (@shfiles) {
+       &scan_sh_file($file);
+    }
+}
+
+sub scan_c_file
+{
+    local($file) = @_;
+    local($in_comment) = 0;    # Nonzero if in a multiline comment.
+
+    open(CFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<CFILE>) {
+       # Strip out comments, approximately.
+       # Ending on this line.
+       if ($in_comment && m,\*/,) {
+           s,.*\*/,,;
+           $in_comment = 0;
+       }
+       # All on one line.
+       s,/\*.*\*/,,g;
+       # Starting on this line.
+       if (m,/\*,) {
+           $in_comment = 1;
+       }
+       # Continuing on this line.
+       next if $in_comment;
+
+       # Preprocessor directives.
+       if (/^\s*#\s*include\s*<([^>]*)>/) {
+           $headers{$1}++;
+       }
+       # Ignore other preprocessor directives.
+       next if /^\s*#/;
+
+       # Remove string and character constants.
+       s,\"[^\"]*\",,g;
+        s,\'[^\']*\',,g;
+
+       # Tokens in the code.
+       # Maybe we should ignore function definitions (in column 0)?
+       while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+           $functions{$1}++ if !defined($c_keywords{$1});
+       }
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $identifiers{$1}++ if !defined($c_keywords{$1});
+       }
+    }
+    close(CFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file functions:\n";
+       foreach $word (sort keys %functions) {
+           print "$word $functions{$word}\n";
+       }
+
+       print "\n$file identifiers:\n";
+       foreach $word (sort keys %identifiers) {
+           print "$word $identifiers{$word}\n";
+       }
+
+       print "\n$file headers:\n";
+       foreach $word (sort keys %headers) {
+           print "$word $headers{$word}\n";
+       }
+    }
+}
+
+sub scan_makefile
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\$\([^\)]*\)//g;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Variable assignments.
+       while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+           $makevars{$1}++;
+       }
+       # Libraries.
+       while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+           $libraries{$1}++;
+       }
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file makevars:\n";
+       foreach $word (sort keys %makevars) {
+           print "$word $makevars{$word}\n";
+       }
+
+       print "\n$file libraries:\n";
+       foreach $word (sort keys %libraries) {
+           print "$word $libraries{$word}\n";
+       }
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+sub scan_sh_file
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+# Print a configure.in.
+sub output
+{
+    local (%unique_makefiles);
+
+    print CONF "dnl Process this file with autoconf to produce a configure script.\n";
+    print CONF "AC_INIT($initfile)\n";
+
+    &output_programs;
+    &output_headers;
+    &output_identifiers;
+    &output_functions;
+
+    # Change DIR/Makefile.in to DIR/Makefile.
+    foreach $_ (@makefiles) {
+       s/\.in$//;
+       $unique_makefiles{$_}++;
+    }
+    print CONF "AC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n";
+
+    close CONF;
+}
+
+# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
+sub print_unique
+{
+    local($macro) = @_;
+
+    if (defined($macro) && !defined($printed{$macro})) {
+       print CONF "$macro\n";
+       $printed{$macro} = 1;
+    }
+}
+
+sub output_programs
+{
+    local ($word);
+
+    print CONF "dnl Checks for programs.\n";
+    foreach $word (sort keys %programs) {
+       &print_unique($programs_macros{$word});
+    }
+    foreach $word (sort keys %makevars) {
+       &print_unique($makevars_macros{$word});
+    }
+    print CONF "dnl Checks for libraries.\n";
+    foreach $word (sort keys %libraries) {
+       print CONF "AC_HAVE_LIBRARY($word)\n";
+    }
+}
+
+sub output_headers
+{
+    local ($word);
+
+    print CONF "dnl Checks for header files.\n";
+    foreach $word (sort keys %headers) {
+       if ($headers_macros{$word} eq 'AC_HAVE_HEADERS') {
+           push(@have_headers, $word);
+       } else {        
+           &print_unique($headers_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_HEADERS(" . join(' ', sort(@have_headers)) . ")\n"
+       if defined(@have_headers);
+}
+
+sub output_identifiers
+{
+    local ($word);
+
+    print CONF "dnl Checks for identifiers.\n";
+    foreach $word (sort keys %identifiers) {
+       &print_unique($identifiers_macros{$word});
+    }
+}
+
+sub output_functions
+{
+    local ($word);
+
+    print CONF "dnl Checks for functions.\n";
+    foreach $word (sort keys %functions) {
+       if ($functions_macros{$word} eq 'AC_HAVE_FUNCS') {
+           push(@have_funcs, $word);
+       } else {        
+           &print_unique($functions_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n"
+       if defined(@have_funcs);
+}
diff --git a/bin/autoreconf.in b/bin/autoreconf.in
new file mode 100644 (file)
index 0000000..87dbb55
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+# autoreconf - remake all Autoconf configure scripts in a directory tree
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+if test $# -eq 0; then paths=.; else paths="$@"; fi
+
+# The xargs grep filters out Cygnus configure.in files.
+find $paths -name configure.in -print |
+xargs grep -l AC_OUTPUT |
+while read confin; do
+  (
+  dir=`echo $confin|sed 's%/[^/][^/]*$%%'`
+  cd $dir || exit 1
+  echo running autoconf in $dir
+  autoconf
+  if grep AC_CONFIG_HEADER configure.in > /dev/null; then
+    echo running autoheader in $dir
+    autoheader
+  fi
+  )
+done
+
diff --git a/bin/autoscan.in b/bin/autoscan.in
new file mode 100644 (file)
index 0000000..cbae762
--- /dev/null
@@ -0,0 +1,389 @@
+#!@PERL@
+eval "exec @PERL@ -S $0 $*"
+    if $running_under_some_shell;
+                        # this emulates #! processing on NIH machines.
+                        # (remove #! line above if indigestible)
+
+# autoscan - Create configure.scan (a preliminary configure.in) for a package.
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+
+require "find.pl";
+
+$datadir = "@datadir@";
+$verbose = 0;
+
+&parse_args;
+&init_tables;
+&find('.');
+&scan_files;
+&output;
+
+exit 0;
+
+# Process any command line arguments.
+sub parse_args
+{
+    local ($usage) = "Usage: $0 [--help] [--verbose] [--version] [srcdir]\n"; 
+
+    foreach $_ (@ARGV) {
+       if (/^--h/) {
+           print "$usage";
+           exit 0;
+       } elsif (/^--verb/) {
+           $verbose = 1;
+       } elsif (/^--vers/) {
+           &version;
+       } elsif (/^[^-]/) {
+           die "$usage" if defined($srcdir);
+           # Top level directory of the package being autoscanned.
+           $srcdir = $_;
+       } else {
+           die "$usage";
+       }
+    }
+
+    $srcdir="." if !defined($srcdir);
+
+    print "srcdir=$srcdir\n" if $verbose;
+    chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n";
+
+    open(CONF, ">configure.scan") ||
+       die "$0: cannot create configure.scan: $!\n";
+}
+
+# Print the version number and exit.
+sub version
+{
+    open(ACG, "<$datadir/acgeneral.m4") ||
+       die "$0: cannot open $datadir/acgeneral.m4: $!\n";
+    while (<ACG>) {
+       if (/define.AC_ACVERSION.\s*([0-9.]+)/) {
+           print "Autoconf version $1\n";
+           exit 0;
+       }
+    }
+    die "Autoconf version unknown\n";
+}
+
+# Put values in the tables of what to do with each token.
+sub init_tables
+{
+    local($kind, $word, $macro, %files);
+
+    # Initialize a table of C keywords (to ignore).
+    # Taken from K&R 1st edition p. 180.
+    # ANSI C, GNU C, and C++ keywords can introduce portability problems,
+    # so don't ignore them.
+    foreach $word ('int', 'char', 'float', 'double', 'struct', 'union',
+                  'long', 'short', 'unsigned', 'auto', 'extern', 'register',
+                  'typedef', 'static', 'goto', 'return', 'sizeof', 'break',
+                  'continue', 'if', 'else', 'for', 'do', 'while', 'switch',
+                  'case', 'default') {
+       $c_keywords{$word} = 0;
+    }
+
+    # The data file format supports only one line of macros per function.
+    # If more than that is required for a common portability problem,
+    # a new Autoconf macro should probably be written for that case,
+    # instead of duplicating the code in lots of configure.in files.
+
+    foreach $kind ('functions', 'headers', 'identifiers', 'programs',
+                  'makevars') {
+       open(TABLE, "<$datadir/ac$kind") ||
+           die "$0: cannot open $datadir/ac$kind: $!\n";
+       while (<TABLE>) {
+           next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
+           ($word, $macro) = split;
+           eval "\$$kind" . "_macros{\$word} = \$macro";
+       }
+       close(TABLE);
+    }
+}
+
+# Collect names of various kinds of files in the package.
+# Called by &find on each file.
+sub wanted
+{
+    if (/^.*\.[chlymC]$/ || /^.*\.cc$/) {
+       $name =~ s?^\./??; push(@cfiles, $name);
+    }
+    elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) {
+       $name =~ s?^\./??; push(@makefiles, $name);
+    }
+    elsif (/^.*\.sh$/) {
+       $name =~ s?^\./??; push(@shfiles, $name);
+    }
+}
+
+# Read through the files and collect lists of tokens in them
+# that might create nonportabilities.
+sub scan_files
+{
+    $initfile = $cfiles[0];            # Pick one at random.
+
+    if ($verbose) {
+       print "cfiles:", join(" ", @cfiles), "\n";
+       print "makefiles:", join(" ", @makefiles), "\n";
+       print "shfiles:", join(" ", @shfiles), "\n";
+    }
+
+    foreach $file (@cfiles) {
+       &scan_c_file($file);
+    }
+
+    foreach $file (@makefiles) {
+       &scan_makefile($file);
+    }
+
+    foreach $file (@shfiles) {
+       &scan_sh_file($file);
+    }
+}
+
+sub scan_c_file
+{
+    local($file) = @_;
+    local($in_comment) = 0;    # Nonzero if in a multiline comment.
+
+    open(CFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<CFILE>) {
+       # Strip out comments, approximately.
+       # Ending on this line.
+       if ($in_comment && m,\*/,) {
+           s,.*\*/,,;
+           $in_comment = 0;
+       }
+       # All on one line.
+       s,/\*.*\*/,,g;
+       # Starting on this line.
+       if (m,/\*,) {
+           $in_comment = 1;
+       }
+       # Continuing on this line.
+       next if $in_comment;
+
+       # Preprocessor directives.
+       if (/^\s*#\s*include\s*<([^>]*)>/) {
+           $headers{$1}++;
+       }
+       # Ignore other preprocessor directives.
+       next if /^\s*#/;
+
+       # Remove string and character constants.
+       s,\"[^\"]*\",,g;
+        s,\'[^\']*\',,g;
+
+       # Tokens in the code.
+       # Maybe we should ignore function definitions (in column 0)?
+       while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
+           $functions{$1}++ if !defined($c_keywords{$1});
+       }
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $identifiers{$1}++ if !defined($c_keywords{$1});
+       }
+    }
+    close(CFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file functions:\n";
+       foreach $word (sort keys %functions) {
+           print "$word $functions{$word}\n";
+       }
+
+       print "\n$file identifiers:\n";
+       foreach $word (sort keys %identifiers) {
+           print "$word $identifiers{$word}\n";
+       }
+
+       print "\n$file headers:\n";
+       foreach $word (sort keys %headers) {
+           print "$word $headers{$word}\n";
+       }
+    }
+}
+
+sub scan_makefile
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\$\([^\)]*\)//g;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Variable assignments.
+       while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
+           $makevars{$1}++;
+       }
+       # Libraries.
+       while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
+           $libraries{$1}++;
+       }
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file makevars:\n";
+       foreach $word (sort keys %makevars) {
+           print "$word $makevars{$word}\n";
+       }
+
+       print "\n$file libraries:\n";
+       foreach $word (sort keys %libraries) {
+           print "$word $libraries{$word}\n";
+       }
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+sub scan_sh_file
+{
+    local($file) = @_;
+
+    open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
+    while (<MFILE>) {
+       # Strip out comments and variable references.
+       s/#.*//;
+       s/\${[^\}]*}//g;
+       s/@[^@]*@//g;
+
+       # Tokens in the code.
+       while (s/\W([a-zA-Z_]\w*)\W/ /) {
+           $programs{$1}++;
+       }
+    }
+    close(MFILE);
+
+    if ($verbose) {
+       local($word);
+
+       print "\n$file programs:\n";
+       foreach $word (sort keys %programs) {
+           print "$word $programs{$word}\n";
+       }
+    }
+}
+
+# Print a configure.in.
+sub output
+{
+    local (%unique_makefiles);
+
+    print CONF "dnl Process this file with autoconf to produce a configure script.\n";
+    print CONF "AC_INIT($initfile)\n";
+
+    &output_programs;
+    &output_headers;
+    &output_identifiers;
+    &output_functions;
+
+    # Change DIR/Makefile.in to DIR/Makefile.
+    foreach $_ (@makefiles) {
+       s/\.in$//;
+       $unique_makefiles{$_}++;
+    }
+    print CONF "AC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n";
+
+    close CONF;
+}
+
+# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
+sub print_unique
+{
+    local($macro) = @_;
+
+    if (defined($macro) && !defined($printed{$macro})) {
+       print CONF "$macro\n";
+       $printed{$macro} = 1;
+    }
+}
+
+sub output_programs
+{
+    local ($word);
+
+    print CONF "dnl Checks for programs.\n";
+    foreach $word (sort keys %programs) {
+       &print_unique($programs_macros{$word});
+    }
+    foreach $word (sort keys %makevars) {
+       &print_unique($makevars_macros{$word});
+    }
+    print CONF "dnl Checks for libraries.\n";
+    foreach $word (sort keys %libraries) {
+       print CONF "AC_HAVE_LIBRARY($word)\n";
+    }
+}
+
+sub output_headers
+{
+    local ($word);
+
+    print CONF "dnl Checks for header files.\n";
+    foreach $word (sort keys %headers) {
+       if ($headers_macros{$word} eq 'AC_HAVE_HEADERS') {
+           push(@have_headers, $word);
+       } else {        
+           &print_unique($headers_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_HEADERS(" . join(' ', sort(@have_headers)) . ")\n"
+       if defined(@have_headers);
+}
+
+sub output_identifiers
+{
+    local ($word);
+
+    print CONF "dnl Checks for identifiers.\n";
+    foreach $word (sort keys %identifiers) {
+       &print_unique($identifiers_macros{$word});
+    }
+}
+
+sub output_functions
+{
+    local ($word);
+
+    print CONF "dnl Checks for functions.\n";
+    foreach $word (sort keys %functions) {
+       if ($functions_macros{$word} eq 'AC_HAVE_FUNCS') {
+           push(@have_funcs, $word);
+       } else {        
+           &print_unique($functions_macros{$word});
+       }
+    }
+    print CONF "AC_HAVE_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n"
+       if defined(@have_funcs);
+}
diff --git a/lib/autoscan/functions b/lib/autoscan/functions
new file mode 100644 (file)
index 0000000..ef4d7e9
--- /dev/null
@@ -0,0 +1,58 @@
+# Ones that have their own macros.
+major          AC_MAJOR_HEADER
+minor          AC_MAJOR_HEADER
+makedev                AC_MAJOR_HEADER
+bcopy          AC_STDC_HEADERS
+bcmp           AC_STDC_HEADERS
+bzero          AC_STDC_HEADERS
+ioctl          AC_GCC_TRADITIONAL
+memchr         AC_STDC_HEADERS
+memcpy         AC_STDC_HEADERS
+memcmp         AC_STDC_HEADERS
+memmove                AC_STDC_HEADERS
+memset         AC_STDC_HEADERS
+index          AC_STDC_HEADERS
+rindex         AC_STDC_HEADERS
+getgroups      AC_GETGROUPS_T
+signal         AC_RETSIGTYPE
+alloca         AC_ALLOCA
+getloadavg     AC_GETLOADAVG
+mmap           AC_MMAP
+setvbuf                AC_SETVBUF_REVERSED
+strcoll                AC_STRCOLL
+utime          AC_UTIME_NULL
+vfork          AC_VFORK
+vprintf                AC_VPRINTF
+vfprintf       AC_VPRINTF
+vsprintf       AC_VPRINTF
+wait3          AC_WAIT3
+
+# Others.
+fnmatch                AC_HAVE_FUNCS
+ftime          AC_HAVE_FUNCS
+gethostname    AC_HAVE_FUNCS
+gettimeofday   AC_HAVE_FUNCS
+getusershell   AC_HAVE_FUNCS
+getcwd         AC_HAVE_FUNCS
+getwd          AC_HAVE_FUNCS
+mkdir          AC_HAVE_FUNCS
+mkfifo         AC_HAVE_FUNCS
+mktime         AC_HAVE_FUNCS
+putenv         AC_HAVE_FUNCS
+re_comp                AC_HAVE_FUNCS
+regcmp         AC_HAVE_FUNCS
+regcomp                AC_HAVE_FUNCS
+rmdir          AC_HAVE_FUNCS
+select         AC_HAVE_FUNCS
+socket         AC_HAVE_FUNCS
+stime          AC_HAVE_FUNCS
+strcspn                AC_HAVE_FUNCS
+strdup         AC_HAVE_FUNCS
+strerror       AC_HAVE_FUNCS
+strftime       AC_HAVE_FUNCS
+strspn         AC_HAVE_FUNCS
+strstr         AC_HAVE_FUNCS
+strtod         AC_HAVE_FUNCS
+strtol         AC_HAVE_FUNCS
+strtoul                AC_HAVE_FUNCS
+uname          AC_HAVE_FUNCS
diff --git a/lib/autoscan/headers b/lib/autoscan/headers
new file mode 100644 (file)
index 0000000..398f864
--- /dev/null
@@ -0,0 +1,27 @@
+# Ones that have their own macros.
+dirent.h       AC_DIR_HEADER
+sys/ndir.h     AC_DIR_HEADER
+sys/dir.h      AC_DIR_HEADER
+ndir.h         AC_DIR_HEADER
+sys/mkdev.h    AC_MAJOR_HEADER
+string.h       AC_STDC_HEADERS
+strings.h      AC_STDC_HEADERS
+stdlib.h       AC_STDC_HEADERS
+stddef.h       AC_STDC_HEADERS
+stdarg.h       AC_STDC_HEADERS
+float.h                AC_STDC_HEADERS
+sys/mtio.h     AC_REMOTE_TAPE
+X11/Xlib.h     AC_FIND_X
+
+# Others.
+fcntl.h                AC_HAVE_HEADERS
+limits.h       AC_HAVE_HEADERS
+paths.h                AC_HAVE_HEADERS
+sgtty.h                AC_HAVE_HEADERS
+sys/file.h     AC_HAVE_HEADERS
+sys/ioctl.h    AC_HAVE_HEADERS
+sys/time.h     AC_HAVE_HEADERS
+sys/window.h   AC_HAVE_HEADERS
+syslog.h       AC_HAVE_HEADERS
+termio.h       AC_HAVE_HEADERS
+unistd.h       AC_HAVE_HEADERS
diff --git a/lib/autoscan/identifiers b/lib/autoscan/identifiers
new file mode 100644 (file)
index 0000000..d200c61
--- /dev/null
@@ -0,0 +1,22 @@
+sys_siglist    AC_SYS_SIGLIST_DECLARED
+mode_t         AC_MODE_T
+off_t          AC_OFF_T
+pid_t          AC_PID_T
+size_t         AC_SIZE_T
+uid_t          AC_UID_T
+gid_t          AC_UID_T
+S_ISDIR                AC_STAT_MACROS_BROKEN
+S_ISREG                AC_STAT_MACROS_BROKEN
+S_ISCHR                AC_STAT_MACROS_BROKEN
+S_ISBLK                AC_STAT_MACROS_BROKEN
+S_ISFIFO       AC_STAT_MACROS_BROKEN
+S_ISLNK                AC_STAT_MACROS_BROKEN
+S_ISSOCK       AC_STAT_MACROS_BROKEN
+st_blksize     AC_ST_BLKSIZE
+st_blocks      AC_ST_BLOCKS
+st_rdev                AC_ST_RDEV
+timeval                AC_TIME_WITH_SYS_TIME
+tm             AC_STRUCT_TM
+tm_zone                AC_TIMEZONE
+const          AC_CONST
+inline         AC_INLINE
diff --git a/lib/autoscan/makevars b/lib/autoscan/makevars
new file mode 100644 (file)
index 0000000..7b33b87
--- /dev/null
@@ -0,0 +1,11 @@
+LN             AC_LN_S
+AWK            AC_PROG_AWK
+CC             AC_PROG_CC
+CPP            AC_PROG_CPP
+CXX            AC_PROG_CXX
+INSTALL                AC_PROG_INSTALL
+LEX            AC_PROG_LEX
+RANLIB         AC_PROG_RANLIB
+YACC           AC_PROG_YACC
+BISON          AC_PROG_YACC
+MAKE           AC_SET_MAKE
diff --git a/lib/autoscan/programs b/lib/autoscan/programs
new file mode 100644 (file)
index 0000000..d61f9db
--- /dev/null
@@ -0,0 +1,18 @@
+ln             AC_LN_S
+awk            AC_PROG_AWK
+nawk           AC_PROG_AWK
+gawk           AC_PROG_AWK
+mawk           AC_PROG_AWK
+cc             AC_PROG_CC
+gcc            AC_PROG_CC
+cpp            AC_PROG_CPP
+CC             AC_PROG_CXX
+g++            AC_PROG_CXX
+install                AC_PROG_INSTALL
+lex            AC_PROG_LEX
+flex           AC_PROG_LEX
+ranlib         AC_PROG_RANLIB
+yacc           AC_PROG_YACC
+byacc          AC_PROG_YACC
+bison          AC_PROG_YACC
+make           AC_SET_MAKE