From: Akim Demaille Date: Tue, 12 Jun 2001 10:05:27 +0000 (+0000) Subject: * autoscan.in (%kind_comment): New. X-Git-Tag: AUTOCONF-2.50a~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49ee5178ef7e8ffe2ef0f60046859ced7c634765;p=thirdparty%2Fautoconf.git * autoscan.in (%kind_comment): New. (output_kind): New. (output_functions, output_identifiers, output_headers): Use it. --- diff --git a/ChangeLog b/ChangeLog index bd8eb6250..778458494 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-06-12 Akim Demaille + + * autoscan.in (%kind_comment): New. + (output_kind): New. + (output_functions, output_identifiers, output_headers): Use it. + 2001-06-12 Akim Demaille * autoscan.in (&print_unique): Take `$kind' and `$word' as diff --git a/autoscan.in b/autoscan.in index 10443e2c2..eb3598cd7 100644 --- a/autoscan.in +++ b/autoscan.in @@ -53,6 +53,12 @@ my %generic_macro = 'libraries' => 'AC_CHECK_LIB' ); +my %kind_comment = + ( + 'functions' => 'Checks for library functions.', + 'headers' => 'Checks for header files.', + 'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.', + ); my $configure_scan = 'configure.scan'; @@ -438,6 +444,36 @@ sub print_unique ($@) } +# output_kind ($KIND) +# ------------------- +sub output_kind ($) +{ + my ($kind) = @_; + my @have; + + print CONF "\n# $kind_comment{$kind}\n"; + foreach my $word (sort keys %{$used{$kind}}) + { + if (defined $macro{$kind}{$word}) + { + if ($macro{$kind}{$word} eq $generic_macro{$kind}) + { + push (@have, $word); + push (@{$needed_macros{"$generic_macro{$kind}([$word])"}}, + @{$used{$kind}{$word}}); + } + else + { + print_unique ($kind, $word); + } + } + } + print CONF "$generic_macro{$kind}([" . join(' ', sort(@have)) . "])\n" + if @have; +} + + + # output_programs () # ------------------ sub output_programs () @@ -471,27 +507,7 @@ sub output_libraries () # ----------------- sub output_headers () { - my @have_headers; - - print CONF "\n# Checks for header files.\n"; - foreach my $word (sort keys %{$used{'headers'}}) - { - if (defined $macro{'headers'}{$word}) - { - if ($macro{'headers'}{$word} eq 'AC_CHECK_HEADERS') - { - push (@have_headers, $word); - push (@{$needed_macros{"AC_CHECK_HEADERS([$word])"}}, - @{$used{'headers'}{$word}}); - } - else - { - print_unique ('headers', $word); - } - } - } - print CONF "AC_CHECK_HEADERS([" . join(' ', sort(@have_headers)) . "])\n" - if @have_headers; + output_kind ('headers'); } @@ -499,27 +515,7 @@ sub output_headers () # --------------------- sub output_identifiers () { - my @have_types; - - print CONF "\n# Checks for typedefs, structures, and compiler characteristics.\n"; - foreach my $word (sort keys %{$used{'identifiers'}}) - { - if (defined $macro{'identifiers'}{$word}) - { - if ($macro{'identifiers'}{$word} eq 'AC_CHECK_TYPES') - { - push (@have_types, $word); - push (@{$needed_macros{"AC_CHECK_TYPES([$word])"}}, - @{$used{'identifiers'}{$word}}); - } - else - { - print_unique ('identifiers', $word); - } - } - } - print CONF "AC_CHECK_TYPES([" . join(', ', sort(@have_types)) . "])\n" - if @have_types; + output_kind ('identifiers'); } @@ -527,27 +523,7 @@ sub output_identifiers () # ------------------- sub output_functions () { - my @have_funcs; - - print CONF "\n# Checks for library functions.\n"; - foreach my $word (sort keys %{$used{'functions'}}) - { - if (defined $macro{'functions'}{$word}) - { - if ($macro{'functions'}{$word} eq 'AC_CHECK_FUNCS') - { - push (@have_funcs, $word); - push (@{$needed_macros{"AC_CHECK_FUNCS([$word])"}}, - @{$used{'functions'}{$word}}); - } - else - { - print_unique ('functions', $word); - } - } - } - print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n" - if @have_funcs; + output_kind ('functions'); } diff --git a/bin/autoscan.in b/bin/autoscan.in index 10443e2c2..eb3598cd7 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -53,6 +53,12 @@ my %generic_macro = 'libraries' => 'AC_CHECK_LIB' ); +my %kind_comment = + ( + 'functions' => 'Checks for library functions.', + 'headers' => 'Checks for header files.', + 'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.', + ); my $configure_scan = 'configure.scan'; @@ -438,6 +444,36 @@ sub print_unique ($@) } +# output_kind ($KIND) +# ------------------- +sub output_kind ($) +{ + my ($kind) = @_; + my @have; + + print CONF "\n# $kind_comment{$kind}\n"; + foreach my $word (sort keys %{$used{$kind}}) + { + if (defined $macro{$kind}{$word}) + { + if ($macro{$kind}{$word} eq $generic_macro{$kind}) + { + push (@have, $word); + push (@{$needed_macros{"$generic_macro{$kind}([$word])"}}, + @{$used{$kind}{$word}}); + } + else + { + print_unique ($kind, $word); + } + } + } + print CONF "$generic_macro{$kind}([" . join(' ', sort(@have)) . "])\n" + if @have; +} + + + # output_programs () # ------------------ sub output_programs () @@ -471,27 +507,7 @@ sub output_libraries () # ----------------- sub output_headers () { - my @have_headers; - - print CONF "\n# Checks for header files.\n"; - foreach my $word (sort keys %{$used{'headers'}}) - { - if (defined $macro{'headers'}{$word}) - { - if ($macro{'headers'}{$word} eq 'AC_CHECK_HEADERS') - { - push (@have_headers, $word); - push (@{$needed_macros{"AC_CHECK_HEADERS([$word])"}}, - @{$used{'headers'}{$word}}); - } - else - { - print_unique ('headers', $word); - } - } - } - print CONF "AC_CHECK_HEADERS([" . join(' ', sort(@have_headers)) . "])\n" - if @have_headers; + output_kind ('headers'); } @@ -499,27 +515,7 @@ sub output_headers () # --------------------- sub output_identifiers () { - my @have_types; - - print CONF "\n# Checks for typedefs, structures, and compiler characteristics.\n"; - foreach my $word (sort keys %{$used{'identifiers'}}) - { - if (defined $macro{'identifiers'}{$word}) - { - if ($macro{'identifiers'}{$word} eq 'AC_CHECK_TYPES') - { - push (@have_types, $word); - push (@{$needed_macros{"AC_CHECK_TYPES([$word])"}}, - @{$used{'identifiers'}{$word}}); - } - else - { - print_unique ('identifiers', $word); - } - } - } - print CONF "AC_CHECK_TYPES([" . join(', ', sort(@have_types)) . "])\n" - if @have_types; + output_kind ('identifiers'); } @@ -527,27 +523,7 @@ sub output_identifiers () # ------------------- sub output_functions () { - my @have_funcs; - - print CONF "\n# Checks for library functions.\n"; - foreach my $word (sort keys %{$used{'functions'}}) - { - if (defined $macro{'functions'}{$word}) - { - if ($macro{'functions'}{$word} eq 'AC_CHECK_FUNCS') - { - push (@have_funcs, $word); - push (@{$needed_macros{"AC_CHECK_FUNCS([$word])"}}, - @{$used{'functions'}{$word}}); - } - else - { - print_unique ('functions', $word); - } - } - } - print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n" - if @have_funcs; + output_kind ('functions'); }