2000-08-01 18:05:11 +08:00
|
|
|
#! @PERL@ -w
|
1994-04-30 09:42:39 +08:00
|
|
|
# autoscan - Create configure.scan (a preliminary configure.in) for a package.
|
2000-10-17 02:25:55 +08:00
|
|
|
# Copyright 1994, 1999, 2000 Free Software Foundation, Inc.
|
1994-04-30 09:42:39 +08:00
|
|
|
|
|
|
|
# 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
|
1996-06-13 01:55:25 +08:00
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# 02111-1307, USA.
|
1994-04-30 09:42:39 +08:00
|
|
|
|
|
|
|
# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
|
|
|
|
|
|
|
|
require "find.pl";
|
2000-08-01 18:05:11 +08:00
|
|
|
use Getopt::Long;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
1994-09-11 14:20:58 +08:00
|
|
|
$datadir = $ENV{"AC_MACRODIR"} || "@datadir@";
|
2000-04-11 20:06:12 +08:00
|
|
|
($me = $0) =~ s,.*/,,;
|
1994-04-30 09:42:39 +08:00
|
|
|
$verbose = 0;
|
2000-04-11 20:06:12 +08:00
|
|
|
|
1994-10-20 19:12:02 +08:00
|
|
|
# Reference these variables to pacify perl -w.
|
|
|
|
undef %identifiers_macros;
|
|
|
|
undef %makevars_macros;
|
|
|
|
undef %programs_macros;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
|
|
|
&parse_args;
|
|
|
|
&init_tables;
|
|
|
|
&find('.');
|
|
|
|
&scan_files;
|
|
|
|
&output;
|
|
|
|
|
|
|
|
exit 0;
|
|
|
|
|
2000-08-01 18:05:11 +08:00
|
|
|
# Display usage (--help).
|
|
|
|
sub print_usage
|
1994-04-30 09:42:39 +08:00
|
|
|
{
|
2000-08-01 18:05:11 +08:00
|
|
|
print "Usage: $0 [OPTION] ... [SRCDIR]
|
1999-01-08 11:38:59 +08:00
|
|
|
|
|
|
|
Examine source files in the directory tree rooted at SRCDIR, or the
|
|
|
|
current directory if none is given. Search the source files for
|
2000-08-01 19:12:12 +08:00
|
|
|
common portability problems and create a file `configure.scan' which
|
|
|
|
is a preliminary `configure.in' for that package.
|
1999-01-08 11:38:59 +08:00
|
|
|
|
2000-03-03 02:17:26 +08:00
|
|
|
-h, --help print this help, then exit
|
|
|
|
-V, --version print version number, then exit
|
1999-01-08 11:38:59 +08:00
|
|
|
-v, --verbose verbosely report processing
|
2000-07-19 17:03:53 +08:00
|
|
|
|
|
|
|
Library directories:
|
|
|
|
-A, --autoconf-dir=ACDIR Autoconf's files location (rarely needed)
|
2000-08-01 19:12:12 +08:00
|
|
|
-l, --localdir=DIR location of `aclocal.m4' and `acconfig.h'
|
1999-01-08 11:38:59 +08:00
|
|
|
|
2000-08-01 18:05:11 +08:00
|
|
|
Report bugs to <bug-autoconf\@gnu.org>.\n";
|
|
|
|
exit 0;
|
|
|
|
}
|
2000-01-10 18:11:57 +08:00
|
|
|
|
2000-08-01 18:05:11 +08:00
|
|
|
# Display version (--version).
|
|
|
|
sub print_version
|
|
|
|
{
|
|
|
|
print "autoscan (GNU @PACKAGE@) @VERSION@
|
2000-01-10 18:11:57 +08:00
|
|
|
Written by David J. MacKenzie.
|
|
|
|
|
2000-10-17 02:25:55 +08:00
|
|
|
Copyright 1994, 1999, 2000 Free Software Foundation, Inc.
|
2000-01-10 18:11:57 +08:00
|
|
|
This is free software; see the source for copying conditions. There is NO
|
2000-08-01 18:05:11 +08:00
|
|
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
|
|
|
|
exit 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Process any command line arguments.
|
|
|
|
sub parse_args
|
|
|
|
{
|
2000-09-04 22:50:50 +08:00
|
|
|
Getopt::Long::config ("bundling");
|
2000-08-01 18:05:11 +08:00
|
|
|
Getopt::Long::GetOptions ("A|autoconf-dir|m|macrodir=s" => \$datadir,
|
|
|
|
"h|help" => \&print_usage,
|
|
|
|
"V|version" => \&print_version,
|
2000-09-04 22:50:50 +08:00
|
|
|
"v|verbose" => \$verbose)
|
2000-08-01 18:05:11 +08:00
|
|
|
or exit 1;
|
|
|
|
|
|
|
|
die "$me: too many arguments
|
2000-08-01 19:12:12 +08:00
|
|
|
Try `$me --help' for more information.\n"
|
2000-08-01 18:05:11 +08:00
|
|
|
if (@ARGV > 1);
|
|
|
|
($srcdir) = @ARGV;
|
|
|
|
$srcdir = "."
|
|
|
|
if !defined($srcdir);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "srcdir=$srcdir\n" if $verbose;
|
|
|
|
chdir $srcdir || die "$me: cannot cd to $srcdir: $!\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-08-01 18:05:11 +08:00
|
|
|
open (CONF, ">configure.scan") ||
|
2000-04-11 20:06:12 +08:00
|
|
|
die "$me: cannot create configure.scan: $!\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Put values in the tables of what to do with each token.
|
|
|
|
sub init_tables
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local($kind, $word, $macro);
|
|
|
|
|
|
|
|
# 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 "$me: 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";
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
close(TABLE);
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Collect names of various kinds of files in the package.
|
|
|
|
# Called by &find on each file.
|
|
|
|
sub wanted
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
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);
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Read through the files and collect lists of tokens in them
|
|
|
|
# that might create nonportabilities.
|
|
|
|
sub scan_files
|
|
|
|
{
|
2000-11-10 23:49:15 +08:00
|
|
|
if (defined $cfiles[0]) {
|
|
|
|
$initfile = $cfiles[0]; # Pick one at random.
|
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
|
|
|
|
if ($verbose) {
|
|
|
|
print "cfiles:", join(" ", @cfiles), "\n";
|
|
|
|
print "makefiles:", join(" ", @makefiles), "\n";
|
|
|
|
print "shfiles:", join(" ", @shfiles), "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach $file (@cfiles) {
|
|
|
|
$programs{"cc"}++;
|
|
|
|
&scan_c_file($file);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach $file (@makefiles) {
|
|
|
|
&scan_makefile($file);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach $file (@shfiles) {
|
|
|
|
&scan_sh_file($file);
|
|
|
|
}
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
sub scan_c_file
|
|
|
|
{
|
|
|
|
local($file) = @_;
|
|
|
|
local($in_comment) = 0; # Nonzero if in a multiline comment.
|
|
|
|
|
|
|
|
open(CFILE, "<$file") || die "$me: cannot open $file: $!\n";
|
|
|
|
while (<CFILE>) {
|
|
|
|
# Strip out comments, approximately.
|
|
|
|
# Ending on this line.
|
|
|
|
if ($in_comment && m,\*/,) {
|
|
|
|
s,.*\*/,,;
|
|
|
|
$in_comment = 0;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
# All on one line.
|
|
|
|
s,/\*.*\*/,,g;
|
|
|
|
# Starting on this line.
|
|
|
|
if (m,/\*,) {
|
|
|
|
$in_comment = 1;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
# Continuing on this line.
|
|
|
|
next if $in_comment;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
# Preprocessor directives.
|
|
|
|
if (/^\s*\#\s*include\s*<([^>]*)>/) {
|
|
|
|
$headers{$1}++;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
# Ignore other preprocessor directives.
|
|
|
|
next if /^\s*\#/;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
# Remove string and character constants.
|
|
|
|
s,\"[^\"]*\",,g;
|
|
|
|
s,\'[^\']*\',,g;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
# 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});
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
|
|
|
close(CFILE);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
if ($verbose) {
|
|
|
|
local($word);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file functions:\n";
|
|
|
|
foreach $word (sort keys %functions) {
|
|
|
|
print "$word $functions{$word}\n";
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file identifiers:\n";
|
|
|
|
foreach $word (sort keys %identifiers) {
|
|
|
|
print "$word $identifiers{$word}\n";
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file headers:\n";
|
|
|
|
foreach $word (sort keys %headers) {
|
|
|
|
print "$word $headers{$word}\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub scan_makefile
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local($file) = @_;
|
|
|
|
|
|
|
|
open(MFILE, "<$file") || die "$me: 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}++;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
# Tokens in the code.
|
|
|
|
while (s/\W([a-zA-Z_]\w*)\W/ /) {
|
|
|
|
$programs{$1}++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(MFILE);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
if ($verbose) {
|
|
|
|
local($word);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file makevars:\n";
|
|
|
|
foreach $word (sort keys %makevars) {
|
|
|
|
print "$word $makevars{$word}\n";
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file libraries:\n";
|
|
|
|
foreach $word (sort keys %libraries) {
|
|
|
|
print "$word $libraries{$word}\n";
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file programs:\n";
|
|
|
|
foreach $word (sort keys %programs) {
|
|
|
|
print "$word $programs{$word}\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub scan_sh_file
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local($file) = @_;
|
|
|
|
|
|
|
|
open(MFILE, "<$file") || die "$me: 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}++;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
|
|
|
close(MFILE);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
if ($verbose) {
|
|
|
|
local($word);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print "\n$file programs:\n";
|
|
|
|
foreach $word (sort keys %programs) {
|
|
|
|
print "$word $programs{$word}\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Print a configure.in.
|
|
|
|
sub output
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local (%unique_makefiles);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print CONF "# Process this file with autoconf to produce a configure script.\n";
|
2000-11-10 23:49:15 +08:00
|
|
|
print CONF "AC_INIT\n";
|
|
|
|
if (defined $initfile) {
|
|
|
|
print CONF "AC_CONFIG_SRCDIR([$initfile])\n";
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
&output_programs;
|
|
|
|
&output_headers;
|
|
|
|
&output_identifiers;
|
|
|
|
&output_functions;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
# Change DIR/Makefile.in to DIR/Makefile.
|
|
|
|
foreach $_ (@makefiles) {
|
|
|
|
s/\.in$//;
|
|
|
|
$unique_makefiles{$_}++;
|
|
|
|
}
|
2000-11-10 23:49:15 +08:00
|
|
|
print CONF "\nAC_CONFIG_FILES([",
|
|
|
|
join("\n ", keys(%unique_makefiles)), "])\n";
|
|
|
|
print CONF "AC_OUTPUT\n";
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
close CONF;
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
|
|
|
|
sub print_unique
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local($macro) = @_;
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
if (defined($macro) && !defined($printed{$macro})) {
|
|
|
|
print CONF "$macro\n";
|
|
|
|
$printed{$macro} = 1;
|
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub output_programs
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local ($word);
|
|
|
|
|
|
|
|
print CONF "\n# 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 "\n# Checks for libraries.\n";
|
|
|
|
foreach $word (sort keys %libraries) {
|
2000-08-01 19:12:12 +08:00
|
|
|
print CONF "# FIXME: Replace `main' with a function in `-l$word':\n";
|
|
|
|
print CONF "AC_CHECK_LIB([$word], [main])\n";
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub output_headers
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local ($word);
|
|
|
|
|
|
|
|
print CONF "\n# Checks for header files.\n";
|
|
|
|
foreach $word (sort keys %headers) {
|
|
|
|
if (defined($headers_macros{$word}) &&
|
|
|
|
$headers_macros{$word} eq 'AC_CHECK_HEADERS') {
|
|
|
|
push(@have_headers, $word);
|
|
|
|
} else {
|
|
|
|
&print_unique($headers_macros{$word});
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
2000-08-01 19:12:12 +08:00
|
|
|
print CONF "AC_CHECK_HEADERS([" . join(' ', sort(@have_headers)) . "])\n"
|
2000-04-11 20:06:12 +08:00
|
|
|
if defined(@have_headers);
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub output_identifiers
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local ($word);
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-04-11 20:06:12 +08:00
|
|
|
print CONF "\n# Checks for typedefs, structures, and compiler characteristics.\n";
|
|
|
|
foreach $word (sort keys %identifiers) {
|
2000-08-01 19:12:12 +08:00
|
|
|
if (defined ($identifiers_macros{$word}) &&
|
|
|
|
$identifiers_macros{$word} eq 'AC_CHECK_TYPES') {
|
|
|
|
push (@have_types, $word);
|
|
|
|
} else {
|
|
|
|
&print_unique ($identifiers_macros{$word});
|
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
2000-08-01 19:12:12 +08:00
|
|
|
print CONF "AC_CHECK_TYPES([" . join(', ', sort(@have_types)) . "])\n"
|
|
|
|
if defined (@have_types);
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub output_functions
|
|
|
|
{
|
2000-04-11 20:06:12 +08:00
|
|
|
local ($word);
|
|
|
|
|
|
|
|
print CONF "\n# Checks for library functions.\n";
|
|
|
|
foreach $word (sort keys %functions) {
|
|
|
|
if (defined($functions_macros{$word}) &&
|
|
|
|
$functions_macros{$word} eq 'AC_CHECK_FUNCS') {
|
|
|
|
push(@have_funcs, $word);
|
|
|
|
} else {
|
|
|
|
&print_unique($functions_macros{$word});
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|
2000-04-11 20:06:12 +08:00
|
|
|
}
|
2000-08-01 19:12:12 +08:00
|
|
|
print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
|
2000-04-11 20:06:12 +08:00
|
|
|
if defined(@have_funcs);
|
1994-04-30 09:42:39 +08:00
|
|
|
}
|